Reputation: 416
I started getting an error when viewing pages in wagtail cms:
ProgrammingError at /cms/pages/
column "wagtailcore_page.content_type_id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT "wagtailcore_page"."id", "wagtailcore_page"."content_...
Viewing the Root CMS page seems to be fine and also editing pages. If i access a child page such as /cms/pages/6/
that works but if i view the parent /cms/pages/5/
it causes the error.
Any ideas how this is happening?
wagtail==1.13.1
Django==1.10.5
The page class looks like:
class LandingPage(Page):
body = StreamField([
('heading', blocks.CharBlock(classname="full title")),
('rich_text', RichTextBlock()),
#('image', ImageChooserBlock()),
('image_grid', ImageGridBlock()),
('two_columns', TwoColumnBlock()),
('landing_map', MapBlock()),
('video_grid', VideoGridBlock()),
('slider', SliderBlock()),
('steps', StepsBlock()),
('pricing', PricingBlock()),
('centered', RichTextBlock(template='blocks/centered.html')),
])
content_panels = Page.content_panels + [
StreamFieldPanel('body'),
]
Update:
If I add a query string ?ordering=title
to the URL it works, it seems there is an issue with the annotate operation in the index view that is causing this, strange thing is, it was working ok before and it works with the same codebase on my staging server so I don't understand how this just started.
Upvotes: 0
Views: 219
Reputation: 416
Discovered issue was related to data/structure in Postgres DB that had been cloned from a working server. Working from a clean DB resolved the issue.
Upvotes: 0