Skip to content

[5.x]: Structure max level limit ignored when dragging collapsed structure #15310

@rogerdawkins

Description

@rogerdawkins

What happened?

Description

NOTE: This issue affects Craft 4 and Craft 5

I have created a Structure with Max Levels set to 2. If a top level entry (level 1) has a child entry it should not be possible to drag it below another level 2 item as it will generate a third level. As per the image below if Top B is dragged below Top A it is blocked correctly.

Screenshot 2024-07-05 at 18 22 44

However, if on the above scenario, the Top A entry is collapsed, as per the image below, then it can be moved.

Screenshot 2024-07-05 at 18 29 58

This then results in a Structure that is 3 levels deep which should not be allowed. Subsequently a 3 levels collapsed structure can be dragged again to create a 4 level deep structure, etc.

Screenshot 2024-07-05 at 18 31 58

Steps to reproduce

  1. Create a Structure with Max Levels = 2
  2. Follow the images above to reproduce the issue.

Expected behavior

It should not be possible to create a 3 level deep structure by dragging. The Move should be blocked.

Actual behavior

Multiple levels can be created by dragging a collapsed structure.

Craft CMS version

5.2.5

PHP version

8.2.20

Operating system and version

Linux 6.5.0-42-generic

Database type and version

MySQL 8.0.36

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions