Skip to content

Fire IContainerModifiedEvent from orderObjects - #66

Open
kunalKumar-13 wants to merge 1 commit into
plone:masterfrom
kunalKumar-13:fix/orderObjects-fires-container-modified
Open

Fire IContainerModifiedEvent from orderObjects#66
kunalKumar-13 wants to merge 1 commit into
plone:masterfrom
kunalKumar-13:fix/orderObjects-fires-container-modified

Conversation

@kunalKumar-13

Copy link
Copy Markdown

Closes #65.

moveObjectsByDelta notifies, so every moveObjects* / moveObjectToPosition
path emits IContainerModifiedEvent. orderObjects mutates the same order
annotation and fires nothing, in both DefaultOrdering and PartialOrdering
exactly as you described.

This adds the notification at the end of orderObjects in both, 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, 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.

Copilot AI lite review requested due to automatic review settings September 4, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mister-roboto

Copy link
Copy Markdown

@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:

@jenkins-plone-org please run jobs

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!

@kunalKumar-13

Copy link
Copy Markdown
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
kunalKumar-13 force-pushed the fix/orderObjects-fires-container-modified branch from 4b733fe to 7cba143 Compare September 4, 2026 23:51
@kunalKumar-13

Copy link
Copy Markdown
Author

@jenkins-plone-org please run jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

orderObjects does not fire ContainerModifiedEvent (moveObjectsByDelta does)

3 participants