New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent behaviour for modified badges and Matrix fields #9814
Comments
These discrepancies are due to PHP and JS having different ways of determining field modification statuses. When you initially load the page, each field type has a chance to get determine whether it should appear as modified. (Matrix chooses to not show that, as its nested fields will get their own modification statuses.) Whereas when edits are autosaved via JS, we can’t (currently) get field types’ input on their modification statuses without completely re-rendering the form, which would slow the autosave down considerably. So instead the JS makes its best guess as to where the new status badges should be added. I do hope to come up with a way for the back-end to drive the front-end status indicators down the road though, so will leave this open and update it when I come up with something. |
Right, I completely get that getting consistent status indicators without a single source of truth for the changes is difficult (would it be possible to return all the fields’ modification statuses as part of the auto-save payload, instead of having the JS guess?)
This is the part that sticks out to me as potentially the most problematic, though - on the initial pageload for an existing draft, there’ll be no indicators at all for Matrix fields where blocks have been added or removed - ie the Matrix field appears untouched. That makes it really easy to miss that a change has been made to the field, as authors will reasonably come to expect indicators for any and all changes, relative to the current entry. |
That would only work for top-level fields, unfortunately.
Yeah good point. I just tweaked this so the entire Matrix field gets highlighted when changed, in addition to the sub-field. So that should basically resolve this, as field status highlights are now consistent for Matrix fields across JS and page reloads. |
Sounds great, thanks Brandon. |
Craft 3.7.13 is out now with that change. |
Description
There is some peculiar behaviour going on with modified badges (i.e. those blue lines) and Matrix fields:
Steps to reproduce
Additional info
The behaviour seems to be identical for provisional drafts and "real" drafts.
The text was updated successfully, but these errors were encountered: