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

Uncaught TypeError in page-editor.js - MultipleChooserPanel #11955

Open
patillacode opened this issue May 15, 2024 · 2 comments
Open

Uncaught TypeError in page-editor.js - MultipleChooserPanel #11955

patillacode opened this issue May 15, 2024 · 2 comments
Labels
status:Unconfirmed Issue, usually a bug, that has not yet been validated as a confirmed problem. type:Bug

Comments

@patillacode
Copy link

Issue Summary

I have selection of authors for a book in my site

Screenshot 2024-05-14 at 15 51 11

And I can select whichever one without issue!

The problem comes when I try to filter by author name, the filtering occurs without any problems but I cannot select any of the authors from the output.

The result is correct, I get the color change on hover meaning I can click on it:

Screenshot 2024-05-14 at 15 54 27

But when I do I get this in the console making reference to page-editor.js

Screenshot 2024-05-14 at 15 56 55
Screenshot 2024-05-14 at 15 56 47

Steps to Reproduce

Assuming you have a working Wagtail app running:

  1. Go to edit any page with a MultipleChooserPanel (classic example of a Blog Post with an Author)
  2. Filter by the author name
  3. See you cannot select any of the given results after the filtering is done.
  • I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: no

Technical details

  • Python version: 3.9.15
  • Django version: 4.2.11
  • Wagtail version: 5.2.3
  • Browser version: Chrome 124

Working on this

In the original conversation on the Slack support channel @lb- mentioned that his guess was that the chooser JS is not being reinstated after the filtering occurs.

@patillacode patillacode added status:Unconfirmed Issue, usually a bug, that has not yet been validated as a confirmed problem. type:Bug labels May 15, 2024
@gasman
Copy link
Collaborator

gasman commented May 15, 2024

Thanks for reporting! I see that the checkboxes are missing from the second screenshot, which probably means that the URL parameter that enables multiple choice has not been preserved when loading the filtered results - it then ends up returning a single result (rather than the expected array of results) to the calling page, which fails as the calling page tries to loop over the results.

@patillacode
Copy link
Author

FYI, in case it helps, the behaviour is correct when you try to change an existing author.

If you have a selected item in your MultipleChooserPanel and want to change it, using the menu option "Choose another page" you get the pop-up/modal and filtering works there without issue.
Screenshot 2024-05-14 at 16 04 13

I still don't get the checkboxes but I can click the results and the value changes correctly.

Screenshot 2024-05-16 at 12 11 19

Screenshot 2024-05-16 at 12 17 21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:Unconfirmed Issue, usually a bug, that has not yet been validated as a confirmed problem. type:Bug
Projects
None yet
Development

No branches or pull requests

2 participants