Skip to content

Sync does not preserve component/module order within page content zones #211

Description

@devben

Environment

  • agility-cli version: 1.0.0-beta.13.28

Summary

When syncing pages between two Agility CMS instances using the CLI, the order of components (modules) within a page's content zone is not preserved. Modules can end up reordered on the target instance, changing how the page renders.

Example

A page synced from a source instance to a target instance had a content zone containing two modules, e.g. ModuleA and ModuleB.

Source page zone:

"main-content-zone": [
  { "title": "Module A", "module": "ModuleA", "item": { "contentid": 111 } },
  { "title": "Module B", "module": "ModuleB", "item": { "contentid": 222 } }
]

Target page zone (after sync):

"main-content-zone": [
  { "title": "Module B", "module": "ModuleB", "item": { "contentid": 333 } },
  { "title": "Module A", "module": "ModuleA", "item": { "contentid": 444 } }
]

The order of ModuleA and ModuleB is swapped between source and target. Zone names, module names, and all other page metadata match as expected — only the ordering within the zone differs.

Impact

Any page whose content zones contain two or more modules is potentially affected, since the relative order of modules controls page rendering order. In our audit of ~112 synced pages, 14 pages had zones with reordered modules after sync — so this isn't universal, but it's also not an isolated one-off; it appears whenever a zone has multiple modules.

Expected behavior

The sync process should preserve the exact order of modules within each content zone as defined on the source instance.

Suggested diagnostic approach

For each synced page pair (source/target), compare the list of module values per zone. A defect is present when sorted(source_modules) == sorted(target_modules) but source_modules != target_modules (same modules present, different order).

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