-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
[REF] Reconcile CRM_Utils_System::getUrlPath and CRM_Utils_System::currentPath #17068
Conversation
(Standard links)
|
Both functions do the same thing; deprecating getUrlPath in favor of the older currentPath.
if (CRM_Utils_Rule::positiveInteger($arg[3])) { | ||
return $arg[3]; | ||
} | ||
if (isset($arg[3]) && $arg[1] == 'report' && $arg[2] == 'instance' && CRM_Utils_Rule::positiveInteger($arg[3])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemanw what if there is no 2
key? I guess that would be covered by the first isset right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. It's always going to be a non-associative array, so if [3]
is set then so are [2]
and [1]
and [0]
.
@colemanw I'll do some |
@colemanw What is not obvious from the description is which one is deprecated! It is obvious looking at the code but would help reviewers :-) |
Thanks @kcristiano for testing. |
@colemanw I've done I think this should be merged so we can have in the next RC |
Overview
Code refactoring to make looking up the current URL more consistent.
Before
$_GET
.After
CRM_Utils_System::getUrlPath
.CRM_Utils_System::currentPath
.$_GET
directly to use the helper function.