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

Changing default slug causes get_site to return no pages. #9848

Closed
kimberlyherman opened this issue Jan 5, 2023 · 3 comments
Closed

Changing default slug causes get_site to return no pages. #9848

kimberlyherman opened this issue Jan 5, 2023 · 3 comments
Labels
status:Needs Info status:Unconfirmed Issue, usually a bug, that has not yet been validated as a confirmed problem. type:Bug

Comments

@kimberlyherman
Copy link

Issue Summary

When we change the slug for a page, the get_url_paths method (called by get_site) in the Page class returns no pages

Steps to Reproduce

  1. Start a new project with wagtail start myproject
  2. Set up a basic content site_ with a few index child pages or use an existing demo built on Wagtail 2.16 that has child pages and the Promote tab in the admin parent page
  3. Add this method to the BlogIndexPage in models.py to get all child pages
    def get_collections():
    res = None
    site = self.get_site()
    if site:
    res = res.in_site(site)
    return res
  4. in your index template add this not pretty, but enough to show the data
    <div> {% page.get_collections %}</div>
  5. run your site and go to the Promote tab on the index page
  6. change the slug, save draft, publish
  7. refresh the index page and see that the data is gone

I expected all results for get_site

Technical details

  • Python version: 3.8
  • Django version: 2.2
  • Wagtail version: 2.16
  • Browser version: Chrome 108
@kimberlyherman kimberlyherman added status:Unconfirmed Issue, usually a bug, that has not yet been validated as a confirmed problem. type:Bug labels Jan 5, 2023
@NXPY123
Copy link
Contributor

NXPY123 commented Sep 30, 2023

@kimberlyherman Can you specify the steps better? I'm having trouble reproducing the issue

@gasman
Copy link
Collaborator

gasman commented Sep 30, 2023

The code snippet above looks incorrect to me - if site is defined, then the line res = res.in_site(site) will attempt to call in_site on None.

@gasman
Copy link
Collaborator

gasman commented Nov 8, 2023

Closing due to lack of updates (and Wagtail 2.16 is well out of support now).

@gasman gasman closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:Needs Info 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

3 participants