Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
After #2849503: Use subform state for the BehaviorForm() functions was committed, after removing/adding container paragraph an error is shown when saving the content.
Proposed resolution
Fix it
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#13 | interdiff-2851402-10-13.txt | 535 bytes | Ginovski |
#13 | error_on_subform_state-2851402-13.patch | 4.21 KB | Ginovski |
#13 | error_on_subform_state-2851402-13-test-only.patch | 3.02 KB | Ginovski |
#10 | error_on_subform_state-2851402-10.patch | 4.46 KB | Ginovski |
#10 | error_on_subform_state-2851402-10-test-only.patch | 3.27 KB | Ginovski |
Comments
Comment #2
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commented1 Added an if check and using the $form instead of $form_state->getCompleteForm() for the submitBehaviorForm.
Comment #4
miro_dietikerThat makes it pretty much critical for this widget.
Beside the fact that the code breaks our existing tests, we need to add tests for the identified problem.
Comment #5
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedAdded an if-check and extended test to check everything is ok when removing a nested paragraph.
Comment #7
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedReturning to needs review, since tests passed
Comment #8
miro_dietikerA test-only patch would have been great to see it fail.
Comment #9
miro_dietikerTested test-only locally and it still passes. So the test seems not to test what it should or the bug is not fixed? :-)
Comment #10
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedFixed test
Comment #13
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedRemoved unused classes in the test.
Comment #16
BerdirWondering if there is some deeper problem here. Can you assert that we actually correctly store the values if we also change behavior plugin settings while moving them?
Comment #18
miro_dietikerOops cross-post / commit. Please provide an update then. :-)
As a result, if you want a full issue test, you need to post a test-only that reverts the previous commit.
Comment #19
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedAddressing Sascha's comment, the values are not stored properly - created a followup #2853146: Behavior plugin values not applying when reordering items.