Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adding a child page fails with postgres #835

Closed
floppya opened this Issue · 1 comment

2 participants

@floppya

After creating a simple cms project according to the instructions in the development documentation, I add two pages via the admin: a root page and then a child through the 'add child' button in the page list. After saving the child page, I get the following error:

ValueError: cache_tree_children was passed nodes in the wrong order!
full stack trace here: https://gist.github.com/1015683

After a little poking around, it seems like the problem originates in cms/admin/change_list.py line 78:

pages = self.get_query_set(request).drafts().order_by('tree_id', 'parent', 'lft').select_related()

which seems innocuous enough at first glance, but gives different results on Postgresql. This is because nulls come at the end of ascending sorts, rather than the beginning like in mysql or sqlite, for example. Since root nodes have parent=null, we find that, on postgres, this puts the root nodes last in order, which causes an error in a later call to mptt.cache_tree_children

I'm using the 'develop' branch of django-cms, Django 1.3, Postgresql 8.4.7

@floppya

Related wontfix django ticket: https://code.djangoproject.com/ticket/13312

@vvangelovski vvangelovski referenced this issue from a commit in vvangelovski/django-cms
@vvangelovski vvangelovski Fix for issues #830 and #835 including tests a89d326
@ojii ojii closed this in 8fb63ce
@vvangelovski vvangelovski referenced this issue from a commit in vvangelovski/django-cms
@vvangelovski vvangelovski Change in the ordering of the queryset in get_query_set of CMSChangeL…
…ist. Related to issue #830 and #835.
71f5a01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.