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

Retrieve tab key from form attributes even when action is urlencoded #13099

Merged
merged 1 commit into from
Nov 15, 2018

Conversation

christianwach
Copy link
Member

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 the form object using basename(), but fails because the q variable is (properly) URL-encoded since #13043.

After

The component is correctly identified by parsing the action attribute of the form object using basename() by not assuming that the URL is in its raw state. The new code URL-decodes the action 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 through wp-admin/admin.php.

@civibot
Copy link

civibot bot commented Nov 15, 2018

(Standard links)

@kcristiano
Copy link
Member

kcristiano commented Nov 15, 2018

tested on WP with CiviCRM 5.8 beta 1 and Drupal 7 with CiviCRM 5.8 beta1

@eileenmcnaughton @seamuslee001 this Patch works well and has been tested. I believe we should add to 5.8

@seamuslee001
Copy link
Contributor

This looks good to me and given Kevin's testing Merging

@seamuslee001 seamuslee001 merged commit fab2567 into civicrm:5.8 Nov 15, 2018
@christianwach christianwach deleted the issue-wp-12-tab branch December 5, 2018 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants