Issue #3627088: Keep the components missing from the order when reordering

Fixes #3627088. Related: #3375164.

reorderComponents() rebuilt the field from the posted order and dropped every component that was not in it. The builder posts the components it rendered, so a component in a region its section's layout does not have was removed by the first reorder anywhere in the builder.

The fix keeps the unlisted components, in their existing order, after the listed ones. Deletion has its own path (deleteComponent()), so deleted components are not brought back.

Testing

  • Cypress: new reorder-unlisted-components.cy.js strands a component (three columns to two), moves another one with the move up button and checks the stranded one is still in the field. It fails without the fix. Full suite on a fresh site: 46/46.
  • Kernel: new ReorderComponentsTest for reorderComponents(). It fails without the fix. CI does not run PHPUnit; it was run locally.

Merge request reports

Loading
Loading