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
Enabling "related pages" causes server error 500 #586
Comments
This is an unexpected error.. I'm not familiar with any objects or methods named On your custom def get_context(self, request):
context = super().get_context(request)
# custom code here, add to context
...
return context |
This may be related to the following: The new functionality - "get_related_pages" in page_models assumes that the parent page derives from any CMS pages - but if the parent page is a regular wagtail page, the following line will causes an exception, not finding the expected method get_index_children().
@vsalvino Please advise if this is expected behaviour / do you assume that non-cms pages are not allowed in the page tree? |
Yes - we make the assumption that all pages which are parents or children of any page derived from I would recommend simply changing any of your models which inherit from Otherwise, you may have to shim your page model quite a bit, for example adding |
Hi, Considering that you actually do not forbid users to use plain Page models, would it be helpful to have a try/catch around the problematic line, not to leave the users in the dark with a potential E500? |
There are 100s of different things that would have to be try/catch, it would probably double the size of the codebase. So that is not something we are interested in. You can still use normal wagtail Similarly, wagtail requires all models to inherit from Sorry I can't be more helpful on this... but the recommended fix would be to change your models from inheriting I'm not sure if this inheritance structure described by @cjkpl is related to the original comment. @sebastian-muthwill do you think this could be part of your problem? |
Describe the bug
I updated from version 1.0* to 2.1.2 and everything went fine except the new related pages feature is not working. It causes a server error 500.
Steps to reproduce
Steps to reproduce the behavior:
related pages
on one article and select one classifierError:
AttributeError: WhereNode' object has no attribute 'select_format'
Expected behavior
Page can be viewed and related pages are showing up
Additional context
I went thru the documentation and saw the "upgrade considerations" part here: https://docs.coderedcorp.com/wagtail-crx/releases/v2.1.0.html
I was not sure if this is necessary or if it will only turn on the related pages on all existing pages (what it seems to be most likely)
And yes, I did apply all migrations after upgrading to the new versions and ran both
makemigrations
as well asmigrate
.My installation is within a "webpages" app in django and I created an own
ArticlePage
subclassingCoderedArticlePage
. Not sure if this could causing the issue.The text was updated successfully, but these errors were encountered: