Page move UI allows selecting ineligible targets via search results
Issue summary
The page move UI is inconsistent when displaying unavailable target parent pages as greyed out. By searching, it is possible to select an ineligible target parent page, and then see an error message after trying to complete the action.
The cause, from user testing, appears to be that ineligible page types are not excluded from the search results. I haven't looked at the code.
Steps to reproduce
Seen on a custom Wagtail site, and confirmed on demo.wagtail.org.
We will try to move About (a StandardPage) into Recipes (a RecipesIndexPage), a combination which is not permitted.
- Load Wagtail Bakery
- Navigate to https://demo.wagtail.org/admin/pages/76/move/
- Select … → Choose another page
- In the modal dialogue, on the Welcome to the Wagtail Bakery! row, select >
- Observe that Recipes (Recipe index page) is greyed out, and the mouse hover state for that row is a symbol (
cursor: not-allowed;)
- In the search box, type "recipes"
- Observe that there is a message above the search results "Only the following page types may be chosen for this field: Person page, Standard page, Home page, Form page, Page, Location page, Bread page. Search results will exclude pages of other types.", but that Recipes (Recipe index page) is included.
- Observe that Recipes (Recipe index page) is no longer greyed out, and the row is clickable.
- Select the Recipes row (the modal dialogue closes)
- Select Confirm
- Observe an error message, and that the page is not moved.
Additional information
At step 7, I would expect the Recipes page not to be in the results.
Failing that, at step 8, I would expect the Recipes result to be greyed out, with a cursor: not-available; style.
Possibly related: #13121
Can be reproduced
Yes, on the bakerydemo
Technical details
- Wagtail version: 7.2.3
Working on this
If you would like to contribute to this issue, follow these steps:
- Confirm that the issue is reproducible, either on a fresh Wagtail project or the bakerydemo.
- Once confirmed, view our contributing guidelines, add a comment to the issue once you're ready to start.
Source: wagtail/wagtail