Skip to content

Icon Input value is incorrect when element IDs are duplicated or changed #278

Description

@MagueresMathieu

Description

The Icon Input field (Editor tab) can display incorrect values in two scenarios:

  1. When you add a ToImage, set its icon, then change its ID, the Icon Input no longer displays the correct label, it shows an empty value instead of the actual icon name.

  2. If two or more ToButton share the same ID, the Icon Input displays the same icon value for both elements, even if only one of them actually had an icon set.

Root cause

Icon names are stored in PyramidMainExtension currentProjectIcons, keyed only by the element's ID (<id>_icon, <id>_endIcon, <id>_innerImage). This means:

  • When an element's ID changes, the dictionary key used to look up its icon (which was built from the old ID) is never updated to reflect the new ID. As a result, the new ID has no matching entry (icon appears empty), while the old entry remains in the dictionary unused, since no element has that old ID anymore.
  • Two elements with the same ID inevitably collide on the same dictionary key, since there's no per-element uniqueness guarantee beyond the user-editable ID.

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