Skip to content

Most ElementPath orderings are off by one

In production, there are 523828 ElementPaths with an ordering of 0, and 2870130 ElementPaths with an ordering of 1. Unless everyone is messing with me and systematically deleting the first element in nearly every folder of every project, something is probably wrong with manage.py reorder_paths or with Element.add_parent. This pattern can also be observed in preprod and in demo:

ElementPath count by ordering

This causes the frontend to almost always display that the first element in a folder is actually element 2, because that's what ListElementNeighbors says.