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
Removes default action name for flattened action urls #12669
Conversation
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.
$label = substr($label, 0, -strlen($defaultActionName)); | ||
if (substr($label, -1) == '/') { | ||
$label = rtrim($label, '/') . '/'; | ||
} |
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.
I think you can just have $label = rtrim($label, '/') . '/';
here instead of the if()
, right? It should have the same effect even if the string doesn't end w/ '/'.
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.
Also does this code need to take into account the [General] action_url_category_delimiter
option? I don't know what the use case would be for it not to be /
, but you never know I guess.
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.
using the config should make sense
// remove the default action name 'index' in the end of flattened urls | ||
if (Common::getRequestVar('flat', 0)) { | ||
$label = $row->getColumn('label'); | ||
if (substr($label, -strlen($defaultActionName)) == $defaultActionName) { |
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.
If a row has a label like /path/to/filenamewithindex
, will this still work?
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.
hm... will change it so that won't match
Also, I think there's probably test coverage for flattened actions reports, but if not, would be good to cover this change in a test. |
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.
Currently in global.ini.php we have action_default_name = index
So maybe the solution could be to make action_default_name =
in global.ini.php so that this setting still does what it used to ?
@@ -1,7 +1,7 @@ | |||
<?xml version="1.0" encoding="utf-8" ?> | |||
<result> | |||
<row> | |||
<label>index</label> | |||
<label></label> |
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.
here it's expected to be /
ie. the root URL
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.
In flattened url reports currently all leading slashes are removed. Should all other labels have leading slashes as well? Otherwise it would be inconsistent
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.
👍 sounds good that all pages have leading slashes
The default action name will still be displayed for non flattened reports. Changing it also won't change any old reports... |
67d1a0d
to
6c50548
Compare
c4561c5
to
ccf0124
Compare
@sgiehl fyi tests result show some possible regression |
I have seen that. I'm not yet sure how to solve that best without regressions... Need to investigate that further... |
d79717b
to
edd92cb
Compare
@mattab guess I now found a way how to always have a leading slash. But one thing needs to be clear here: Changing that might break some custom alerts defined by users. CustomAlerts plugin uses flatten reports for comparing actions. As the returned actions changes (leading slash and removed default action name) this might change results of defined alerts... |
e6fcbc2
to
9bcbb5e
Compare
@sgiehl the tests results look good now 👍 Feedback:
|
@sgiehl i was expecting that the PR includes the change in global.ini.php: |
@mattab As the title says it currently only changes flattened reports. |
@sgiehl Makes sense. And what do you think about the idea of changing the setting to |
We maybe should only do that for new installs as otherwise we might create inconsistency between old and new tracked data & reports. |
@sgiehl noticed there's an integration test failing in CustomAlerts, could you update the submodule so the test passes? |
Sure. Would do that directly before merging. Is everything else here good to merge? |
* remove default action name for flattened action urls * improve code * update system tests * always prepend action delimiter to flattened action urls * update ui files * update test files * updates CHANGELOG * submodule update
When flattening url action reports the
default_action_name
(default: index) is still contained in the labels.This changes will remove that.
fixes #12651