Hello,
I’m creating a plugin und added the achiv mechanism. Everything works fine (selection of day, week, month, year), beside the selection of a time range. Range shows allways no result, though there has to be a result.
Does anyone have an idea where the problem is?
Have a nice day
illuxio
matthieu
(Matthieu Aubry)
May 25, 2012, 10:50am
2
Please compare your code with the existing archiving plugins maybe?
I did and there are no real differentes.
Sort update:
I have the following code snippets:
public function archivePeriod($notification) {
$archiveProcessing = $notification -> getNotificationObject();
if (!$archiveProcessing -> shouldProcessReportsForPlugin($this -> getPluginName())) {
return;
}
$archiveProcessing -> archiveDataTable(array(self::ARCHIV_ENTRY_NAME));
}
[right]For generating the archives of a period. [/right]
public function getDataTable($idSite, $period, $date, $segment = null, $expanded = null) {
Piwik::checkUserHasViewAccess($idSite);
$dataTable = Piwik_Archive::getDataTableFromArchive(Piwik_404Referrer::ARCHIV_ENTRY_NAME, $idSite, $period, $date, $segment, $expanded);
return $dataTable;
}
[right]For getting the Piwik_DataTable from the archiv. [/right]
All works excepte the period ‘range’.
matthieu
(Matthieu Aubry)
May 26, 2012, 4:40am
4
Sorry I cant say for sure, it would take time beyond the normal “free support” but I agree we should have better examples toreuse…
[quote=illuxio]
I did and there are no real differentes.
Sort update:
I have the following code snippets:
public function archivePeriod($notification) {
$archiveProcessing = $notification -> getNotificationObject();
if (!$archiveProcessing -> shouldProcessReportsForPlugin($this -> getPluginName())) {
return;
}
$archiveProcessing -> archiveDataTable(array(self::ARCHIV_ENTRY_NAME));
}
[right]For generating the archives of a period. [/right]
public function getDataTable($idSite, $period, $date, $segment = null, $expanded = null) {
Piwik::checkUserHasViewAccess($idSite);
$dataTable = Piwik_Archive::getDataTableFromArchive(Piwik_404Referrer::ARCHIV_ENTRY_NAME, $idSite, $period, $date, $segment, $expanded);
return $dataTable;
}
[right]For getting the Piwik_DataTable from the archiv. [/right]
All works excepte the period ‘range’.[/quote]
The problem was that constant “self::ARCHIV_ENTRY_NAME” has the wrong name. The db entries have to begin with the plugin name!
matthieu
(Matthieu Aubry)
May 29, 2012, 9:50am
6
OH thanks for noting this this is right… not very clear.