Skip to content
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

Value Error at Pattern Library - fullpageurl tag expected a Page object #438

Open
MugoBrian opened this issue Oct 28, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@MugoBrian
Copy link
Contributor

MugoBrian commented Oct 28, 2023

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:

  1. home_page.html head to pattern-library/pattern/patterns/pages/home/home_page.html
  2. content_page.html head to pattern-library/pattern/patterns/pages/content_page/content_page.html
  3. 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):

  1. Gitpod
  2. Locally (Ubuntu 22.0.4)

Screenshot from 2023-10-28 09-30-04

@thibaudcolas thibaudcolas added the bug Something isn't working label Nov 4, 2023
@ayaan-qadri
Copy link

@thibaudcolas First two are not reproducible anymore, probably resolved by past commits

Screenshots

Image
Image

but 3rd one is still reproducible:

Screenshots

Firefox:

Image

Chrome:

Image

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`

Image

why does it give True as above ?,
I wonder that it should be either null or blank as per model !!?:

main_image = models.ForeignKey(
"images.WagtailIOImage",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
)

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?).

class WagtailIOImage(AbstractImage):
admin_form_fields = (
"title",
"file",

No more ValueError

replaced all {% if page.main_image %} to {% if page.main_image.file %} (total 3)

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants