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

Notice: Undefined offset: Y in core/DataArray.php on line 109 #4687

Closed
mattab opened this issue Feb 16, 2014 · 5 comments
Closed

Notice: Undefined offset: Y in core/DataArray.php on line 109 #4687

mattab opened this issue Feb 16, 2014 · 5 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Feb 16, 2014

This was reported in the forums

Notice: Undefined offset: 4 in /var/www/html/webstats.sapphirewebservices.com/core/DataArray.php on line 109

The bug appeared for two users when they changed "visit" scope custom variables to "page" scope custom variables.

Instead, this should work as expected and not write out an error message.

@mattab
Copy link
Member Author

mattab commented Feb 17, 2014

In 0730510: Fixes #4687 Initializes the row values so this works without errors even in this edge case. I couldn't easily reproduce this error in a test, so just fixing the bug as is.

@anonymous-matomo-user
Copy link

mattab: Sorry, I dont have a working dev env (yet) - Can you pl. accept my below patch as a one-off. Thanks.

I had the same issue, but the patch applied did not work. I had to move it a few lines up, and add some more enums to the list to work:

Basically remove the existing patch, and apply the below code to line no 102 of core/DataArray.php
-------------8<-----------------------------------------8<---------------------
// In case the existing Row had no action metrics (eg. Custom Variable XYZ with "visit" scope)
// but the new Row has action metrics (eg. same Custom Variable XYZ this time with a "page" scope)
if(!isset($oldRowToUpdate[Metrics::INDEX_MAX_ACTIONS])) {
$toZero = array(Metrics::INDEX_NB_VISITS,
Metrics::INDEX_NB_ACTIONS,
Metrics::INDEX_NB_UNIQ_VISITORS,
Metrics::INDEX_MAX_ACTIONS,
Metrics::INDEX_SUM_VISIT_LENGTH,
Metrics::INDEX_BOUNCE_COUNT,
Metrics::INDEX_NB_VISITS_CONVERTED);
foreach($toZero as $metric) {
$oldRowToUpdate[$metric] = 0;
}
}
-------------8<-----------------------------------------8<---------------------

@mattab
Copy link
Member Author

mattab commented Feb 23, 2014

can you please follow instructions at: http://forum.piwik.org/read.php?2,109735,page=1#msg-109779

and then post the message you are getting after making the patch from this forum post?
Thanks!

@anonymous-matomo-user
Copy link

matt: Strange thing - am unable to reproduce the bug - Even without the patch! Is there some kind of indexing that might be at work?

I even tried adding more data, just in case it was caching at work - but I see the new goals taking place, but not able to reproduce the error!

What gives?

@mattab
Copy link
Member Author

mattab commented Feb 27, 2014

to reproduce you would have to re-process the data: How do I force the reports to be re-processed from the logs?

please reopen the ticket, with full error message (using latest 2.1RC), if you can reproduce. cheers

@mattab mattab added this to the 2.2.1 - Piwik 2.2.1 milestone Jul 8, 2014
@mattab mattab self-assigned this Jul 8, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…t errors even in this edge case. I couldn't easily reproduce this error in a test, so just fixing the bug as is.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants