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

PHP Notice when running CronArchive in loadCustomDateRangeToPreProcess #7647

Closed
tsteur opened this issue Apr 9, 2015 · 2 comments
Closed
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Apr 9, 2015

Getting the following notice:

WARNING CoreConsole[2015-04-08 23:58:48] /home/vagrant/www/piwik/core/CronArchive.php(1537): Notice - Undefined index: defaultReportDate - Piwik 2.13.0-b1 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)

More details:

vagrant@piwik-trusty64:~/www/piwik$ ./console core:archive --url=apache.piwik --force-idsites=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
INFO CoreConsole[2015-04-08 23:58:36] ---------------------------
INFO CoreConsole[2015-04-08 23:58:36] INIT
INFO CoreConsole[2015-04-08 23:58:36] Piwik is installed at: http://apache.piwik/index.php
INFO CoreConsole[2015-04-08 23:58:36] Running Piwik 2.13.0-b1 as Super User
INFO CoreConsole[2015-04-08 23:58:37] ---------------------------
INFO CoreConsole[2015-04-08 23:58:37] NOTES
INFO CoreConsole[2015-04-08 23:58:37] - Reports for today will be processed at most every 150 seconds. You can change this value in Piwik UI > Settings > General Settings.
INFO CoreConsole[2015-04-08 23:58:37] - Reports for the current week/month/year will be refreshed at most every 3600 seconds.
INFO CoreConsole[2015-04-08 23:58:37] - Archiving was last executed without error 19 hours 50 min ago
INFO CoreConsole[2015-04-08 23:58:37] Will invalidate archived reports for 2015-04-09 for following siteIds: 1,3,5
INFO CoreConsole[2015-04-08 23:58:37] - Will process 105 websites (--force-idsites)
INFO CoreConsole[2015-04-08 23:58:37] ---------------------------
INFO CoreConsole[2015-04-08 23:58:37] START
INFO CoreConsole[2015-04-08 23:58:37] Starting Piwik reports archiving...
INFO CoreConsole[2015-04-08 23:58:40] Archived website id = 1, period = day, 3587 visits in last last52 days, 30 visits today, Time elapsed: 2.831s
INFO CoreConsole[2015-04-08 23:58:42] Archived website id = 1, period = week, 1122 visits in last last2 weeks, 90 visits this week, Time elapsed: 1.398s
INFO CoreConsole[2015-04-08 23:58:44] Archived website id = 1, period = month, 1852 visits in last last2 months, 874 visits this month, Time elapsed: 1.897s
INFO CoreConsole[2015-04-08 23:58:48] Archived website id = 1, period = year, 6022 visits in last last2 years, 6022 visits this year, Time elapsed: 4.772s
WARNING CoreConsole[2015-04-08 23:58:48] /home/vagrant/www/piwik/core/CronArchive.php(1537): Notice - Undefined index: defaultReportDate - Piwik 2.13.0-b1 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)

That for loop seems broken:

foreach ($userPreferences as $userLogin => $userPreferences) {

Notice $userPreferences will be overwritten. Also I think getAllUsersPreferences does not return default values so a key might be not set.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Apr 9, 2015
@mattab
Copy link
Member

mattab commented Apr 9, 2015

Moved to 2.13.0 as something is potentially broken?

@mattab mattab added this to the Piwik 2.13.0 milestone Apr 9, 2015
mnapoli added a commit that referenced this issue Apr 12, 2015
@mnapoli mnapoli self-assigned this Apr 12, 2015
mnapoli added a commit that referenced this issue Apr 12, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Apr 12, 2015

PR: #7666

diosmosis added a commit that referenced this issue Apr 15, 2015
Fixes #7647 In CronArchive:: loadCustomDateRangeToPreProcess, fix variable in for loop overwriting itself, and do not execute archiving of custom date ranges for user if the PREFERENCE_DEFAULT_REPORT_DATE preference is for some reason not set.
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

3 participants