When I go here admin/support/plan_report and I click on generate report I get the following error message and no report generated.

Notice: Undefined index: client_actual in support_pm_admin_reports() (line 205 of /home/plstest/public_html/sites/all/modules/support/support_pm/support_pm.admin.inc).
Notice: Undefined index: user_actual in support_pm_admin_reports() (line 216 of /home/plstest/public_html/sites/all/modules/support/support_pm/support_pm.admin.inc).

Comments

BartGysens’s picture

Issue summary: View changes

Same issue here, any responses yet?

jeremy’s picture

Priority: Normal » Major

Raising priority; it's very broken atm. Patches welcome.

bazzly’s picture

If its the same thing I think it is..
https://www.drupal.org/node/1945242
If you have access to the Administer Plan overview, or something like that... Click on your profile name and you should see an option where it says support plan.If you click it, you should be able to create a support plan "Edit plan". Once you have a plan in place that page should work.

skari’s picture

The problem is that the keys 'client_actual' and 'user_actual' are not defined unless the support_timer module is downloaded and enabled. So, the simple fix is to check if these keys are defined, as in the following patch:

diff --git a/sites/all/modules/contrib/support/support_pm/support_pm.admin.inc b/sites/all/modules/contrib/support/support_pm/support_pm.admin.inc
index 6c3e48a..7ed855b 100644
--- a/sites/all/modules/contrib/support/support_pm/support_pm.admin.inc
+++ b/sites/all/modules/contrib/support/support_pm/support_pm.admin.inc
@@ -202,7 +202,7 @@
 
     $header_client = array(t('Plan'));
     $client_plan_sum = is_array($totals['client_plan']) ? array_sum($totals['client_plan']) : 0;
-    $client_actual_sum = is_array($totals['client_actual']) ? array_sum($totals['client_actual']) : 0;
+    $client_actual_sum = isset($totals['client_actual']) && is_array($totals['client_actual'])? array_sum($totals['client_actual']) : 0;
     $max = $client_plan_sum > $client_actual_sum ? $client_plan_sum : $client_actual_sum;
     $row = array(theme('support_pm_user_hours_summary', array('totals' => $totals['client_plan'], 'load_callback' => 'support_client_load', 'max' => $max, 'message' => t('Not scheduled'))));
     if (count($row2) > 1) {
@@ -213,7 +213,7 @@
 
     $header_user = array(t('Plan'));
     $user_plan_sum = is_array($totals['user_plan']) ?  array_sum($totals['user_plan']) : 0;
-    $user_actual_sum = is_array($totals['user_actual']) ? array_sum($totals['user_actual']) : 0;
+    $user_actual_sum = isset($totals['user_actual']) && is_array($totals['user_actual']) ? array_sum($totals['user_actual']) : 0;
     $max = $user_plan_sum > $user_actual_sum ? $user_plan_sum : $user_actual_sum;
     $row = array(theme('support_pm_user_hours_summary', array('totals' => $totals['user_plan'], 'load_callback' => 'user_load', 'max' => $max, 'message' => t('Not scheduled'))));
     if (count($row2) > 1) {

Then as bazzly points out (in #3) users need to edit their plan (i.e. register their time spent doing ticket work) in order for the report to show anything (unless, of course, the support_timer module is being used)

purencool’s picture

Version: 7.x-1.0-rc2 » 8.x-1.x-dev