Skip to content

orderObjects does not fire ContainerModifiedEvent (moveObjectsByDelta does) #65

Description

@jensens

DefaultOrdering.moveObjectsByDelta calls notifyContainerModified(self.context), so all moveObjects* / moveObjectToPosition paths emit IContainerModifiedEvent. orderObjects (sort by key or reverse) mutates the same order annotation but fires nothing. Same in PartialOrdering.

Together with OFS (_setObject/_delObject, CopySupport) this makes orderObjects the only ordering mutation that subscribers cannot observe. Anything that mirrors folder order externally misses these changes; concrete case: plone.pgcatalog keeps stored getObjPositionInParent values in sync via an IContainerModifiedEvent subscriber (see bluedynamics/plone-pgcatalog#216).

Proposal: call notifyContainerModified(self.context) at the end of orderObjects when the order was touched, in both implementations. Happy to send a PR.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions