Fire IContainerModifiedEvent from orderObjects - #66
Open
kunalKumar-13 wants to merge 1 commit into
Open
Conversation
|
@kunalKumar-13 thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment: To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
Author
|
@jenkins-plone-org please run jobs |
Closes plone#65. `moveObjectsByDelta` calls `notifyContainerModified`, so every `moveObjects*` and `moveObjectToPosition` path emits `IContainerModifiedEvent`. `orderObjects` mutates the same order annotation and fires nothing, in both `DefaultOrdering` and `PartialOrdering` -- which makes it the only ordering mutation a subscriber cannot observe, as reported. Notify at the end of `orderObjects` in both implementations, after the order has actually been rewritten. The no-op path -- no key and no reverse, which returns -1 early without touching anything -- stays silent, and there is a test for that in each suite so a later change cannot start announcing work that did not happen. Six tests added, three per implementation: sort-by-key notifies, reverse-only notifies, and the no-op does not. Reverting the two source changes fails exactly the four positive tests and leaves the two negative ones passing.
kunalKumar-13
force-pushed
the
fix/orderObjects-fires-container-modified
branch
from
September 4, 2026 23:51
4b733fe to
7cba143
Compare
Author
|
@jenkins-plone-org please run jobs |
Open
4 tasks
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.
Closes #65.
moveObjectsByDeltanotifies, so everymoveObjects*/moveObjectToPositionpath emits
IContainerModifiedEvent.orderObjectsmutates the same orderannotation and fires nothing, in both
DefaultOrderingandPartialOrdering—exactly as you described.
This adds the notification at the end of
orderObjectsin both, after the orderhas actually been rewritten. The no-op path (no key and no reverse, which returns
-1early without touching anything) stays silent, and there is a test for thatin each suite so a later change cannot start announcing work that did not happen.
Six tests, three per implementation: sort-by-key notifies, reverse-only notifies,
the no-op does not. Suite goes 74 → 80, all passing. Reverting just the two
source changes fails exactly the four positive tests and leaves the two negative
ones green.
You offered to send a PR yourself — if you have one in progress, say the word and
I will close this; it seemed better to save you the time than to leave it sitting.