Navigation Menu

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

Display all product categories if present in the visitor log #14083

Merged
merged 9 commits into from Apr 11, 2019

Conversation

diosmosis
Copy link
Member

Fixes #14072

@diosmosis diosmosis added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Feb 10, 2019
@diosmosis diosmosis added this to the 3.9.0 milestone Feb 10, 2019
@@ -370,7 +370,11 @@ protected function renderDataTable($array, $prefixLine = "")
foreach ($row as $name => $value) {
// handle the recursive dataTable case by XML outputting the recursive table
if (is_array($value)) {
$value = "\n" . $this->renderDataTable($value, $prefixLine . "\t\t");
if (is_array(reset($value))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a (system) test for this maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically since it's used in the <categories> array, it's already tested in this PR. If possible I can add a unit test as well.

$suffix = $i === 0 ? '' : $i;
$column = $i === 0 ? 'idaction_category' : ('idaction_category' . ($i + 1));
$categorySelects[] = 'log_action_category' . $suffix . '.name as itemCategory' . $suffix;
$categoryJoins[] = 'LEFT JOIN ' . Common::prefixTable('log_action') . " AS log_action_category$suffix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reckon performance won't be a big problem because of adding so many more joins but may be still good to do (maybe we have many categories in the demo on staging?).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If easily doable...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean performance test on staging?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I wonder if we should deploy the change on the server and check if it still loads as fast when eg loading 500 or 1000 ecommerce log entries compared to before? not sure we have many entries with categories though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could always add some more categories to the test data and load it on staging if not. Would take a couple days though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah not needed to add more categories. Not worth it I think

@sgiehl
Copy link
Member

sgiehl commented Mar 6, 2019

UI and System test files need an update.
@diosmosis do you think it may sense to extend the UI tests so we have multiple categories displayed somewhere? Otherwise should be good to merge I think

@diosmosis
Copy link
Member Author

I added an extra category to a system test and regenerated OmniFixture (not sure there was an existing fixture w/ multiple categories), hopefully it will show up in the ecommerce log UI test result.

@tsteur
Copy link
Member

tsteur commented Mar 12, 2019

Looks good to merge once tests pass. There are a few failing system tests and to fix the UI tests might need to be merge 3.x-dev into it.

Couldn't see multiple categories in a UI test but I think it's not needed.

@mattab mattab modified the milestones: 3.9.0, 3.10.0 Mar 18, 2019
@tsteur tsteur merged commit 12416e0 into 3.x-dev Apr 11, 2019
@tsteur tsteur deleted the 14072-all-product-cats branch April 11, 2019 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants