Value Error at Pattern Library - fullpageurl tag expected a Page object
Issue: The following error (see screenshot below) is being encountered when accessing the following pages: home_page.html content_page.html blog_page.html
Steps To Reproduce The Error: Start the wagtail.org server To access the:
- home_page.html head to pattern-library/pattern/patterns/pages/home/home_page.html
- content_page.html head to pattern-library/pattern/patterns/pages/content_page/content_page.html
- blog_page.html head to pattern-library/pattern/patterns/pages/blog/blog_page.html
Environment Used: The issue occurs in both of these environments both using Docker and Chrome Browser Version 118.0.5993.117 (Official Build) (64-bit):
- Gitpod
- Locally (Ubuntu 22.0.4)
@thibaudcolas First two are not reproducible anymore, probably resolved by past commits
Screenshots
but 3rd one is still reproducible:
Screenshots
Firefox:
Chrome:
I tried to debug it and and found that checking for {% if page.main_image %} evolutes true and main_image's value is also True
main_image is `True`
why does it give True as above ?,
I wonder that it should be either null or blank as per model !!?:
https://github.com/wagtail/wagtail.org/blob/5eac6fb3c1bf79be093e55bcac0cb8b2217e5f41/wagtailio/blog/models.py#L141-L147
Currently, we can check for the file field for main_image instead of just main_image, {% if page.main_image.file %} and it works fine (should i raise PR with this approach?).
https://github.com/wagtail/wagtail.org/blob/5eac6fb3c1bf79be093e55bcac0cb8b2217e5f41/wagtailio/images/models.py#L8-L11
No more ValueError
replaced all {% if page.main_image %} to {% if page.main_image.file %} (total 3)