Conversation
Saving the popup without an attribute, or with one deleted meanwhile, answered 500: inserting copies the attribute's predefined values and the attribute was null. The popup now shows a validation message instead. The check lives in the action because the validation rules popup posts the same model without an attribute.
added 2 commits
November 27, 2026 20:33
…ute-mapping-required # Conflicts: # src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml # src/Web/Grand.Web/App_Data/Resources/Upgrade/en_250.xml
…ute-mapping-required
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type: bugfix
Issue
Saving the product attribute mapping popup (product → Product attributes → Add new) without an attribute, or with one deleted while the popup was open, answers 500. Inserting the mapping copies the attribute's predefined values, and
GetProductAttributeByIdreturned null for the missing attribute. Admin, store and vendor panels share the action.Solution
ProductAttributeMappingPopup(POST) adds a model error ("Please select an attribute.") when the attribute is empty or does not exist, and the popup shows it. The check lives in the action, not inProductAttributeMappingModelValidator, because the validation rules popup posts the same model without an attribute and would then fail to save.New resource
Admin.Catalog.Products.ProductAttributes.Attributes.Fields.Attribute.Required, inDefaultLanguage.xmlandUpgrade/en_250.xml.Breaking changes
None. The action has a new
[FromServices] IProductAttributeServiceparameter; the panel controllers do not override it.Testing
ProductAttributeId), save: the popup stays open with "Please select an attribute." instead of a 500.Test:
BaseProductAttributeMappingControllerTests.ProductAttributeMappingPopup_Post_NoSuchAttribute_ReturnsView_DoesNotInsert.