Skip to content

Cloning of widgets inside a layout #8537

@AndreaPiovanelli

Description

@AndreaPiovanelli

When I clone a layout, the widgets inside it aren't really cloned, but a reference to the original widget is saved.
This causes a breaking issue when editing or deleting the child widget, which gets edited or deleted across multiple layouts (because they have the same id).
Case scenario:

  • Creation of Layout widget 1 (with id 1), with child widget 1 (with id 2)
  • Cloning of Layout widget 1
  • The cloned content is Layout widget 2 (id = 3), with child widget 1 inside it (id = 2!)
    To avoid this problem, I need to edit the ImportElement routine in order to create a brand new widget (forcing its cloning) only when the original container is different from the clone container (this condition ensures it's a cloning operation and not a standard import).

The line of code I'm working on is:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions