This is a partial duplicate of a direct support request raised through email.
I have 2 Structure sections that have been behaving just fine in Craft 18.104.22.168:
- One of them continues to be fine
- But the other has become a hierarchical mess of randomness, and any attempts to drag entries into the correct hierarchy frequently generate an "unknown error" message.
I have taken steps to isolate what happens by clearing caches, emptying
/storage/logs, doing a specific entry drag and drop which generates an error, and sending the resultant
web.log to Craft Support.
The purpose of this thread is to ask how I might fix this at the database level.
I can see that the
structureelements table has columns for:
Fields 1, 2 and 6 are self-evident but it's not clear to me what fields 3 to 5 do.
Furthermore, for example…
In the Structure section that is working fine, I have an entry #654 that is a level 2 child of entry #786 but I cannot see the latter referenced in the
structureelements row for #654.
Any pointers much appreciated.
Update: Oli at Craft has pointed me at nested sets (thanks).
For my 2 example entries cited above (from the Structure that continues to work without error) I have:
|id|structureId|elementId|root|lft|rgt|level| |--|-----------|---------|----|---|---|-----| |41|2 |786 |31 |4 |13 |1 | |35|2 |654 |31 |5 |6 |2 |
Still not sure what the values of 4, 13, 5, and 6 key into – and therefore how I might go about fixing the Structure section that is broken.
In case it is of relevance, the Structure that is working fine only has live enabled entries in it, but the Structure that is broken has lots of disabled entries. It seems unlikely that is relevant as the now broken Structure was working fine for quite a while with disabled entries.