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

RecursionError using Latest Pages block with article pages #366

Open
pascalthivierge opened this issue Sep 24, 2020 · 4 comments
Open

RecursionError using Latest Pages block with article pages #366

pascalthivierge opened this issue Sep 24, 2020 · 4 comments
Labels
Type: Bug Something isn't working

Comments

@pascalthivierge
Copy link

Describe the bug

When using Latest Pages block on an article page, and selecting parent article landing page as source, if the current article page is in the listed latest pages, it crashes. The article landing page is also crashing.

Steps to reproduce

Steps to reproduce the behavior:

  1. On an article page, use the Latest Pages block
  2. Select parent page of current article as source
  3. Select any number of pages to list, making sure the current page will be listed with the ordering specified in the parent’s LAYOUT tab.
  4. RecursionError

Expected behavior

It should list all latest pages, including or excluding the current page.

@pascalthivierge pascalthivierge added the Type: Bug Something isn't working label Sep 24, 2020
@vsalvino
Copy link
Contributor

Yes, this is a known bug. Thanks for reporting it with detailed steps to reproduce.

I'm not sure on the best way to solve this. One way would be to not allow selecting an ancestor of the current page in the latest pages block. Open to suggestions or a pull request if you have any ideas. Regardless, there should be better documentation with a warning about this behavior!

@pascalthivierge
Copy link
Author

Ok, your post #155 explains the known behavior.

IMHO, being able to select an ancestor is a must...

Would it be possible to simply exclude the current page from results, to avoid recursion?

@vsalvino
Copy link
Contributor

Excluding the current page is not enough. If you select an ancestor (say a blog landing page) that page could render the sub-pages on it, as part of its content. Which then must load the current page in order to render the blog landing page. So there is simply no way to guarantee there won't be recursion - each page could be totally different based on what content the developer has put on it.

It's not just limited to ancestors. Say we have a Home Page which has two children, A and B. If A has a preview or latest pages of B, that will work. But if B also tries to do a preview or latest pages of A, you now have a recursion problem.

@pascalthivierge
Copy link
Author

hmm...

Since page preview listing is not, strictly speaking, real content... maybe it should be excluded from content previewing. Does it make sense?

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

No branches or pull requests

2 participants