-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Editor: Multi-entity saving: Show correct count of entities to be saved #66482
Conversation
The modal was incorrectly displaying the number of different *types* of entities to be saved. This result was inconsistent with the actual list of entities rendered underneath and with the "Review _n_ changes" label on the left-hand sidebar.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -1 B (0%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
…ed (WordPress#66482) The modal was incorrectly displaying the number of different *types* of entities to be saved. This result was inconsistent with the actual list of entities rendered underneath and with the "Review _n_ changes" label on the left-hand sidebar.
What?
Fix the count of unsaved entities in the multi-entity saving UI:
The modal was incorrectly displaying the number of different types of entities to be saved. In the scenario above, it was incorrectly reporting 3 unsaved changed, because there were three types thereof (Site, Template, Template Part).
This result was inconsistent with the actual list of entities rendered underneath, as well as with the "Review n changes" label on the left-hand sidebar.
For reference, the bug was introduced in #58706.
How?
Read directly from the "source", i.e. the
dirtyEntityRecords
array available as component props. Disregard the value ofsortedPartitionedSavables
, which is a grouping of records obtained fromdirtyEntityRecords
and keyed by entity name.Testing Instructions