Needs review
Project:
Webform Navigation
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2026 at 20:20 UTC
Updated:
29 Oct 2026 at 08:52 UTC
Jump to comment: Most recent
When wizard_progress_states is enabled, Webform::getPages($operation, $webform_submission) re-evaluates every page's #states through webform_submission.conditions_validator on every call. Webform doesn't cache that result.
The module calls it more often than it needs to:
getCurrentPage() (src/WebformNavigationHelper.php:144-147) calls getPages() even when $webform_submission->getCurrentPage() is already set. The result is only used as a fallback.hasAccessToPage() (:490-494) calls getPages() on every call, including inside the validateAllPages() loop (:408) and the error loop in WebformNavigationHandler::validateForm().alterForm() and both progress preprocess hooks each call it again.getCurrentPage(), return the submission's current page directly when it is set, and only call getPages() as the fallback.hasAccessToPage(), and in loops that call it, compute the accessible page keys once per submission per request and reuse them. This could share the memo proposed in the "memoize getErrors()/hasVisitedPage()" issue.None.
None.
None.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
shubhamgoel commentedHi Team,
getCurrentPage(): It now returns the submission's current page directly when it is set. It only looks up the pages when none is set, and then returns the first one.
hasAccessToPage(): It now reads the accessible page keys from a new getAccessiblePageKeys() helper.
Please review and merge the MR https://git.drupalcode.org/project/webformnavigation/-/merge_requests/29....
Comment #5
rymcveighI would like to address this issue before this work to ensure our changes don't introduce regressions. It would be great if you could review it so we can move forward with this issue.
Comment #6
rymcveighComment #7
rymcveighComment #8
shubhamgoel commentedHi @rymcveigh,
I have rebased the MR to reflect the latest changes. Please review and merge the MR