CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Undefined variable: combinations in groupByStat() line 2237 of Form.php
Pages: [1]

Author Topic: Undefined variable: combinations in groupByStat() line 2237 of Form.php  (Read 1117 times)

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Undefined variable: combinations in groupByStat() line 2237 of Form.php
June 13, 2013, 10:16:02 am
Notice: Undefined variable: combinations in groupByStat() (line 2237 of /home/xxx/public_html/drupal/sites/all/modules/civicrm/CRM/Report/Form.php).

Ok, I think can see the issue but can't fix it. 

Triggered by a Report called "Event Participants This Month" that groups by events "this month."  There is not really a group by statement, but somewhere in the code it wants to display groupby stats.  I see the offending code is here and $combinations never gets set.  Needs to have an else statement somewhere but I'm not going to even try.:
      foreach ($this->_columns as $tableName => $table) {
        if (array_key_exists('group_bys', $table)) {
          foreach ($table['group_bys'] as $fieldName => $field) {
            if (CRM_Utils_Array::value($fieldName, $this->_params['group_bys'])) {
              $combinations[] = $field['title'];
            }
          }
        }
      }
      $statistics['groups'][] = array('title' => ts('Grouping(s)'),
                                'value' => implode(' & ', $combinations),
      );


Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Undefined variable: combinations in groupByStat() line 2237 of Form.php
June 16, 2013, 06:59:54 am
What version of CiviCRM? What CMS?

Can you reproduce this bug on the demo?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Undefined variable: combinations in groupByStat() line 2237 of Form.php
June 16, 2013, 12:23:19 pm
Are notices displayed? Either way the code is definitely not catching a valid condition. 

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Undefined variable: combinations in groupByStat() line 2237 of Form.php
June 18, 2013, 08:42:56 am
Hi Hershel - are you trying to debug this?  I know this is a trivial bug but I see there are some fixes in Jira that didn't pass QA.  Do you need more info?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Undefined variable: combinations in groupByStat() line 2237 of Form.php
June 18, 2013, 09:47:37 am
I am not working on this but for anyone to work on it they would need to know what CMS and what CiviCRM version.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Undefined variable: combinations in groupByStat() line 2237 of Form.php

This forum was archived on 2017-11-26.