Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Goals/Controller.php')
-rw-r--r--plugins/Goals/Controller.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php
index c0c7d2f766..247a579cd2 100644
--- a/plugins/Goals/Controller.php
+++ b/plugins/Goals/Controller.php
@@ -124,6 +124,7 @@ class Controller extends \Piwik\Plugin\Controller
$this->setGeneralVariablesView($view);
$this->setGoalOptions($view);
$view->onlyShowAddNewGoal = true;
+ $view->ecommerceEnabled = $this->site->isEcommerceEnabled();
$this->execAndSetResultsForTwigEvents($view);
return $view->render();
}
@@ -142,12 +143,16 @@ class Controller extends \Piwik\Plugin\Controller
{
if (empty($view->onlyShowAddGoal)) {
$beforeGoalListActionsBody = [];
- foreach ($view->goals as $goal) {
- $str = '';
- Piwik::postEvent('Template.beforeGoalListActionsBody', [&$str, $goal]);
- $beforeGoalListActionsBody[$goal['idgoal']] = $str;
+ if ($view->goals) {
+ foreach ($view->goals as $goal) {
+ $str = '';
+ Piwik::postEvent('Template.beforeGoalListActionsBody', [&$str, $goal]);
+
+ $beforeGoalListActionsBody[$goal['idgoal']] = $str;
+ }
}
+
$view->beforeGoalListActionsBodyEventResult = $beforeGoalListActionsBody;
$str = '';