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

Page Add preloads all pages #2027

Open
Jehfen opened this issue Jan 16, 2025 · 3 comments
Open

Page Add preloads all pages #2027

Jehfen opened this issue Jan 16, 2025 · 3 comments

Comments

@Jehfen
Copy link

Jehfen commented Jan 16, 2025

Short description of the issue

ProcessPageAdd preloads lots of pages. When removing all the "Show in the add-page shortcut menu" in template files, the issue goes away.

Expected behavior

ProcessPageAdd shouldn't preload any pages.

Actual behavior

Showing any admin page that has the "Add New+" button in it takes forever. Example, login takes 18 seconds and debug mode shows that 70.000 pages are loaded!

Optional: Screenshots/Links that demonstrate the issue

Optional: Suggestion for a possible fix

Steps to reproduce the issue

  1. Enable "Show in the add-page shortcut menu" in a template file that is used by lots of pages (50.000+)
  2. Goto the Pages startpage

Setup/Environment

  • ProcessWire version: 3.0.244
  • (Optional) PHP version: 8.3
  • (Optional) MySQL version: Mariadb 10.6
  • (Optional) Any 3rd party modules that are installed and could be related to the issue: None that i can think of, I disabled all extra installed modules, but the issue persisted.
@ryancramerdesign
Copy link
Member

@Jehfen If the "Show in add-page shortcut menu" is requested/enabled, then ProcessPageAdd needs to load pages that can be potential parents in order to verify that they are allowed to show in that menu. It only does this once per login session, as the result is cached for the life of the session. If it is loading 70k pages then it means that you have a ton of potential parents. You'd want to refine your template family settings so that it's not so wide-open in terms of where things can be added. But this is also a case where I would suggest not checking the "Show in add-page shortcut menu" box except for templates where you need it (if any). You can also add your own custom bookmarks to the menu (see last option).

@Jehfen
Copy link
Author

Jehfen commented Feb 6, 2025

The 70.000 pages are all children; So probably I haven't restricted those child templates for being used as a parent, if I understand it correctly? It looked like it was preloading all the children.
Anyways I just unchecked "Show in add-page shortcut menu" for those templates.

@elabx
Copy link

elabx commented Feb 6, 2025

This just happened to me doing a ProcessWire version update, unchecking "Show in add-page shorcut menu" solved it for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants