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

Fix "crmURL" parameters in various templates #12968

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

christianwach
Copy link
Member

Overview

As described on CiviCRM Lab, in Smarty templates, when the q parameter is prefixed with an ampersand, for example:

{crmButton p='civicrm/contact/view/delete' q="&reset=1&delete=1&cid=$contactId" class="delete" icon="trash"}

the resulting URL contains && like this:

http://civicrm.local/wp-admin/admin.php?page=CiviCRM&q=civicrm/contact/view/delete&&reset=1&delete=1&cid=202

Before

URLs have double ampersands (&&) e.g.

http://civicrm.local/wp-admin/admin.php?page=CiviCRM&q=civicrm/contact/view/delete&&reset=1&delete=1&cid=202

After

URLs do not have double ampersands, e.g.

http://civicrm.local/wp-admin/admin.php?page=CiviCRM&q=civicrm/contact/view/delete&reset=1&delete=1&cid=202

@civibot
Copy link

civibot bot commented Oct 19, 2018

(Standard links)

@civibot civibot bot added the master label Oct 19, 2018
@christianwach
Copy link
Member Author

Related PR: #11708

@totten
Copy link
Member

totten commented Oct 19, 2018

Looks good. This makes a ton of sense from r-code perspective.

For r-run, I spot-checked the changes in Contact/Summary.tpl and paymentBlock.tpl on both (a) the patched autobuild site and (b) an unpatched local site. The Summary.tpl button still works. In both cases, the expected cleanup appeared in the URL.

Tangentially, in paymentBlock.tpl on D7 with demo data (view source for http://core-12968-6mrg.test-1.civicrm.org:8001/civicrm/contribute/transact?reset=1&id=1), there was another extra & (...currency=USD&&is_back_office=...), but that's a different problem. This PR still looks like a clear cleanup.

@totten totten merged commit 9a5c5c4 into civicrm:master Oct 19, 2018
@christianwach christianwach deleted the issue-459 branch December 5, 2018 11:34
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.

2 participants