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 Multi-Site functionality »
  • Notice: Only variable references should be returned by reference error
Pages: [1]

Author Topic: Notice: Only variable references should be returned by reference error  (Read 2897 times)

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Notice: Only variable references should be returned by reference error
June 11, 2012, 05:14:07 am
Working with groups, I get the following error:

Quote
Notice: Only variable references should be returned by reference in CRM_Contact_BAO_GroupOrganization::retrieve() (line 121 of [site]/sites/all/modules/civicrm/CRM/Contact/BAO/GroupOrganization.php).
Notice: Undefined index: organization_id in CRM_Group_Form_Edit->setDefaultValues() (line 184 of [site]/sites/all/modules/civicrm/CRM/Group/Form/Edit.php).

I've tried creating organizations as contacts and assigning the groups appropriately - the error persists. I should mention here that I'm using multi-site with Drupal Domain Access, which seems to be working pretty well.

Thanks for any guidance!

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Notice: Only variable references should be returned by reference error
August 07, 2012, 01:17:35 pm
Bumping this - still seeing the same error; this should be reproducible. Any ideas? Thanks...

chiebert

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 1
  • CiviCRM version: 4.3
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Notice: Only variable references should be returned by reference error
December 01, 2012, 12:31:23 pm
Getting the same thing - using a multi-site setup (Drupal 7 multi-site with two sites, with shared CiviCRM 4.2). I'm not using Drupal Domain Access. I get the errors when visiting the Manage Groups page on either Drupal site, as well as on group settings pages (e.g., http://my-site/civicrm/group?reset=1&action=update&id=2).

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Notice: Only variable references should be returned by reference error
December 01, 2012, 01:01:26 pm
This is fixed and will be part of next 4.2.x release. Here is the patch:

Code: [Select]
Index: CRM/Contact/BAO/GroupOrganization.php
===================================================================
--- CRM/Contact/BAO/GroupOrganization.php (revision 43846)
+++ CRM/Contact/BAO/GroupOrganization.php (working copy)
@@ -110,7 +110,7 @@
   }
 
   static
-  function &retrieve($groupID, &$defaults) {
+  function retrieve($groupID, &$defaults) {
     $dao = new CRM_Contact_DAO_GroupOrganization();
     $dao->group_id = $groupID;
     if ($dao->find(TRUE)) {
Index: CRM/Group/Form/Edit.php
===================================================================
--- CRM/Group/Form/Edit.php (revision 43846)
+++ CRM/Group/Form/Edit.php (working copy)
@@ -177,7 +177,7 @@
           $this->_groupOrganizationID = $defaults['group_organization'];
         }
 
-        $this->assign('organizationID', $defaults['organization_id']);
+        $this->assign('organizationID', CRM_Utils_Array::value('organization_id', $defaults));
       }
     }

HTh
Kurund
Found this reply helpful? Support CiviCRM

chiebert

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 1
  • CiviCRM version: 4.3
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Notice: Only variable references should be returned by reference error
December 01, 2012, 02:04:40 pm
Brilliant! Thanks, Kurund.

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Notice: Only variable references should be returned by reference error
December 01, 2012, 02:30:17 pm
Ditto... thanks Kurund! And thanks, @chiebert, for bringing it up again so long after the fact!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Multi-Site functionality »
  • Notice: Only variable references should be returned by reference error

This forum was archived on 2017-11-26.