Repository navigation
Conversation
Two blocks can render the same widget parameter. Magento\Widget\Block\Adminhtml\Widget\Options emits every parameter, including the ones declared visible="false", as a field carrying the widget.xml default; a module adding its own options block to the adminhtml_widget_loadoptions handle then renders some of those parameters again as visible fields under the same name. Prototype's accumulator concatenated duplicates, so parameters[loop] arrived as ['0','1']: selects were forced to their first allowed option and text parameters were imploded or dropped. It now follows the submit semantics of a form: a trailing [] makes a value a list, everything else is last one wins, unchecked checkboxes and radios are skipped rather than contributing their value attribute, and disabled, file, submit and button fields are left out. Reading the element directly instead of looking it up by id also stops fields without an id from being dropped.
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.
Two blocks can render the same widget parameter. Magento\Widget\Block\Adminhtml\Widget\Options emits every parameter, including the ones declared visible="false", as a field carrying the widget.xml default; a module adding its own options block to the adminhtml_widget_loadoptions handle then renders some of those parameters again as visible fields under the same name. Prototype's accumulator concatenated duplicates, so parameters[loop] arrived as ['0','1']: selects were forced to their first allowed option and text parameters were imploded or dropped.
It now follows the submit semantics of a form: a trailing [] makes a value a list, everything else is last one wins, unchecked checkboxes and radios are skipped rather than contributing their value attribute, and disabled, file, submit and button fields are left out. Reading the element directly instead of looking it up by id also stops fields without an id from being dropped.
Closes #27