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 label filter does not work on all reports or depending on used parameters #7463

Closed
wants to merge 1 commit into from

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Mar 18, 2015

I noticed sometimes a label filter does not work. This is because the DataTable thinks the IndexFromLabelToId is up to date but it is not. It will then fail to get the row by label.

Here it [https://github.com/piwik/piwik/blob/2.12.0-b5/core/API/DataTableManipulator/LabelFilter.php#L72](tries to get the row by label) and [https://github.com/piwik/piwik/blob/2.12.0-b5/core/DataTable.php#L610](here it thinks the index is up to date which it is not).

How can this happen?

When we update the label on a row directly eg via $row->setColumn('labe'l, 'newvalue') the dataTable won't notice that the index has to be updated. Same when doing eg $table->queueFilter('ColumnCallbackReplace', array('label', 'Piwik\Plugins\Referrers\getPathFromUrl')); or $table->queueFilter('GroupBy', array('label', 'Piwik\Plugins\Referrers\getPathFromUrl')); for example here: https://github.com/piwik/piwik/blob/2.12.0-b5/plugins/Referrers/DataTable/Filter/UrlsFromWebsiteId.php

For now the only way to make sure the index is up date when applying the label filter is to rebuild it. In another pull request I will on top invalidate the index for those 2 filters but this does not actually solve all problems. Only by rebuilding the index we can be sure to have the correct index.

@tsteur
Copy link
Member Author

tsteur commented Mar 18, 2015

Actually I will include this pull request in another pull request. Sorry for that.

@tsteur tsteur closed this Mar 18, 2015
@tsteur tsteur added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Mar 18, 2015
@tsteur tsteur deleted the rowevolution_fix branch April 17, 2015 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

1 participant