Retrieve tab key from form attributes even when action is urlencoded #13099
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fixes problems associated with Contribution Page forms and Event Management forms as described in this comment by @kcristiano.
The issue has appeared since #13043 because the existing code relied on URLs not being URL-endcoded to tease out the component for the active tab. Please see the discussion on the linked issue for further details.
This PR replaces #13090 and #13089.
Before
The component is misidentified by parsing the
action
attribute of theform
object usingbasename()
, but fails because theq
variable is (properly) URL-encoded since #13043.After
The component is correctly identified by parsing the
action
attribute of theform
object usingbasename()
by not assuming that the URL is in its raw state. The new code URL-decodes theaction
URL when needed before teasing out the component name.Comments
This only fails in WordPress because Drupal uses clean URLs by default and WordPress can never use clean URLs in
wp-admin
because everything is routed throughwp-admin/admin.php
.