I’m getting a REALLY strange error on the dashboard page (inside each stats panel).
The error is occuring in the PrivacyManager::getPurgeDataSettings() function.
There is an error. Please report the message (Piwik 2.7.0) and full backtrace in the Piwik forums (please do a Search first as it might have been reported already!).
Notice: Undefined index: delete_logs_enable in ...\piwik\plugins\PrivacyManager\PrivacyManager.php on line 167
Backtrace -->
#0 Piwik\Error::errorHandler(...) called at [...\piwik\plugins\PrivacyManager\PrivacyManager.php:167]
#1 Piwik\Plugins\PrivacyManager\PrivacyManager::getPurgeDataSettings(...) called at [...\piwik\plugins\PrivacyManager\PrivacyManager.php:331]
#2 Piwik\Plugins\PrivacyManager\PrivacyManager::shouldReportBePurged(...) called at [...\piwik\plugins\PrivacyManager\PrivacyManager.php:122]
#3 Piwik\Plugins\PrivacyManager\PrivacyManager::hasReportBeenPurged(...) called at [...\piwik\core\Plugin\Visualization.php:403]
...etc.
The strange part isn’t that theres an undefined index error, the strange part is that i’ve debugged the code and the array key does actually exist, and it still throws this error…
The line of code in question reads:
$settings[$configKey] = $values[$configKey];
If i put a var_dump($values) right above that line, here’s what comes out…
array(5) {
'delete_logs_enable' => string(1) "0"
'delete_logs_schedule_lowest_interval' => string(1) "7"
'delete_logs_older_than' => string(3) "180"
'delete_logs_max_rows_per_query' => string(6) "100000"
'enable_auto_database_size_estimate' => string(1) "1"
}
As you can see, the array does indeed contain the key that we’re trying to assign.
Additionally, array_key_exists(‘delete_logs_enable’, $values) returns TRUE!
I can’t for the life of me figure out why PHP is treating this code this way…
PIWIK version: 2.7.0
PHP version 5.6.0
Any ideas would be greatly appreciated.
UPDATE
After running the same tests on all sites, there are widgets that will display without generating this error.
Any widget that has data for the specified period displays without error.
Any widget with no data, first displays the error, then “There is no data for this report.” below the error.