Skip to content

Commit

Permalink
Fix issue with filterLogic
Browse files Browse the repository at this point in the history
Update $forceRun to only work if a GET parameter is specified
  • Loading branch information
kcmcg committed Apr 25, 2024
1 parent 5f98cca commit 42244c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
27 changes: 17 additions & 10 deletions callCron.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,35 @@
if($module == ""){
$module = $this;
}

if($module->isSuperuser()) {
$forceRun = (bool)$_GET['forceRun'];
}
else {
$forceRun = false;
}
$report = htmlentities($_GET['report'],ENT_QUOTES);

if($cronAttributes['cron_name'] == ""){
#MANUAL
if(!empty($report) && array_key_exists('report', $_GET)) {
Crons::runCacheReportCron($module, $project_id, $report);
Crons::runGraphReportCron($module, $project_id, $report);
Crons::runCacheReportCron($module, $project_id, $report,$forceRun);
Crons::runGraphReportCron($module, $project_id, $report,$forceRun);
}else {
Crons::runCacheCron($module, $project_id,true);
Crons::runCacheReportCron($module, $project_id, null,true);
Crons::runGraphCron($module, $project_id,true);
Crons::runGraphReportCron($module, $project_id, null,true);
Crons::runCacheCron($module, $project_id,$forceRun);
Crons::runCacheReportCron($module, $project_id, null,$forceRun);
Crons::runGraphCron($module, $project_id,$forceRun);
Crons::runGraphReportCron($module, $project_id, null,$forceRun);
}
}else{
#CRONS
if ($cronAttributes['cron_name'] == 'dashboard_cache_file'){
Crons::runCacheCron($module, $project_id,true);
Crons::runCacheCron($module, $project_id,$forceRun);
}else if ($cronAttributes['cron_name'] == 'dashboard_cache_file_report'){
Crons::runCacheReportCron($module, $project_id, null,true);
Crons::runCacheReportCron($module, $project_id, null,$forceRun);
}else if ($cronAttributes['cron_name'] == 'dashboard_cache_file_graph'){
Crons::runGraphCron($module, $project_id,true);
Crons::runGraphCron($module, $project_id,$forceRun);
}else if ($cronAttributes['cron_name'] == 'dashboard_cache_file_graph_report'){
Crons::runGraphReportCron($module, $project_id, null,true);
Crons::runGraphReportCron($module, $project_id, null,$forceRun);
}
}
2 changes: 1 addition & 1 deletion classes/R4Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public function applyFilterToData($filterLogic) {
$matchingData = [];

foreach($this->getProjectData() as $projectRow) {
if(\LogicTester::applyLogic($funcName,$argMap,[$this->getEventId() => $projectRow])) {
if(\LogicTester::applyLogic($funcName,$argMap,[$this->getEventId() => $projectRow],$this->getEventId(),false,$this->projectId)) {
$matchingData[] = $projectRow;
}
}
Expand Down

0 comments on commit 42244c1

Please sign in to comment.