Fix row iterator value desync between data attribute and jQuery data when reordering rows#1518
Conversation
jtsternberg
left a comment
There was a problem hiding this comment.
This looks good, thank you!
Hi @jtsternberg following this merged pr can we expect an release with this fix any time soon? |
|
hi @jtsternberg sorry to chase, but do you have an estimated time to release this fix? |
|
+1 for release date of this fix. Thanks. |
|
Also looking for a release date of this fix |
|
I'd also like to see this change being incorporated into a proper release. Could @tw2113 take a look at this, since he is listed as one of the maintainers for the cmb2 package on Packagist? |
|
I help with general support/communications, but I still leave anything commit/release with Justin. |
|
Hi, when will this fix be incorporated? The bug that this would fix has caused a lot of issues. Thanks. |
|
Hi @jtsternberg are there any plans to make a new release with this fix included? A bit over a year has passed since this PR was merged. Let me know if there's anything I could do to help. |
Description
Motivation and Context
Fixes #1461
The cmb.shiftRows method only updates the row iterator value stored in the data attribute, however the wysiwyg.initRow method that initializes the fields after rearrangement gets the iterator values using the jQuery data method instead.
The changed code now correctly updates both of the iterator values and thus keeps them in sync.
I also separated the code that's responsible for updating the iterator in data attributes from the one that updates the name attributes. Both of the iterator values are now updated a bit further down the code and it signals more clearly that the values should be kept in sync for developers making changes to the method in the future.
Risk Level
I think the risk level of this change is quite small as it only affects the editor.
Testing procedure
I have tested that ordering groups containing wysiwyg fields works correctly in both the classic editor and the block editor.
Types of changes
Checklist: