-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.x]: Structure parents with no children show expand caret #11253
Comments
Not able to reproduce this. How did you delete the descendants? |
I've deleted the page and recreated it which fixes the issue because a new element is created and the structure tree is cleaned up. Probably a super edge case… could have also happened while I was working on a module so I'm going to close this. |
This is an edge case for sure, and this may or may not be what caused the original issue here (I debated creating a new issue or not), but I do think there is a bug here related to how Craft determines if structure entries should display the child toggles or not. One thing that definitely triggers very similar behavior is if an author creates a new child entry that is never saved (i.e. the draft is never converted from an unpublished draft to a provisional draft). Being unsaved, the draft will be excluded from displaying in the entry index, but the parent structure entry will still display a "show/hide children" toggle for it, as the unsaved draft still counts as a descendant. In cases where a structure entry only has unpublished drafts as children, the end result is a child toggle that does nothing, exactly like in the screencast above. The thing that makes this a edge case is that (AFAIK) there's not actually a way in the UI to create an unsaved draft that is also a child of another entry, as the action of adding a parent entry to a draft via the UI will "save" the draft (i.e. it's converted to a provisional draft), just like any other content edit. But, there's at least one other way to create an unpublished draft that is a child of another entry: using the
TL;DR: Unsaved drafts should probably be excluded in the (An interesting aside: as far as I can tell, the only place unpublished drafts actually do display, is in the "Choose parent" element selector modal. That could be intentional, or perhaps a separate issue - my guess is that they shouldn't be visible there either?). |
I believe we are showing the toggle if the entry’s
Not quite – when you create a new unsaved draft, it will immediately be placed within the structure. And even provisional drafts will have a place within the structure if they have been assigned a different parent than the canonical entry. |
Hm... I'm slightly confused now, but it looks to me like the toggles are shown if the individual structure element has descendants, which is deduced from a per-element And I don't think the issue is that the unsaved draft isn't placed within the structure – the problem is that the element index doesn't display unsaved drafts, whilst the Possibly that |
Doh… I forgot we switched to actually checking for descendants at some point. 🤦🏻 Yep, |
Craft 3.7.64 and 4.3.7 have been released with that fix. |
What happened?
Description
Screen.Recording.2022-05-18.at.10.39.26.am.mov
Steps to reproduce
Expected behavior
Parent entry should have no caret
Actual behavior
Parent entry has caret
Craft CMS version
4.0.2
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: