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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Smart Group error when trying to create
Pages: [1] 2

Author Topic: Smart Group error when trying to create  (Read 967 times)

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Smart Group error when trying to create
October 08, 2014, 02:42:17 pm
CiviCRM 4.5.0
Drupal 7

Hi all...

I am trying to create a new smart group but in doing so get the following error...

Fatal error: Cannot access protected property CRM_Contact_Form_Task_SaveSearch::$_id in sites/all/modules/civicrm/CRM/Group/Form/Edit.php on line 502

line 502 in edit.php points to;

$required = (($obj->_id && CRM_Core_BAO_Domain::isDomainGroup($obj->_id)) ||


The same applies when I try to update an existing smart group.

Can anyone advise?

Cheers
Robbie


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Smart Group error when trying to create
October 08, 2014, 06:18:48 pm

whats your PHP version?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Re: Smart Group error when trying to create
October 08, 2014, 11:29:27 pm
Hi Lobo

The default version of the servers I am using is PHP 5.3.28. But I can enable PHP 5.4.24

Robbie

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Smart Group error when trying to create
October 09, 2014, 07:08:34 am

yeah, might want to see if the error disappear with 5.4

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Re: Smart Group error when trying to create
October 09, 2014, 07:50:59 am
Hi Lobo

I amended the route .htaccess file to include the line 'AddHandler application/x-httpd-php54 .php' as instructed by the hosting support...but the error still occurs. see the start of the code, not sure if this is the correct way to do it though.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?ereps\.eu$
RewriteRule ^(.*)$ http://www.ereps.eu.com/$1 [R=301,L]
#
# Apache/PHP/Drupal settings:
#

AddHandler application/x-httpd-php54 .php

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(|~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
  Order allow,deny
</FilesMatch>


I only got this error after upgradingto 4.5.0 last week, but everything else seems to be working fine...

Robbie

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Smart Group error when trying to create
October 09, 2014, 08:44:01 am

sorry, no idea.

as a last shot, can u try and repeat the steps on the demo server. if we can reproduce it there might make it easier for us to investigate/debug

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Re: Smart Group error when trying to create
October 09, 2014, 09:05:54 am
ok...will give it a go

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Re: Smart Group error when trying to create
October 09, 2014, 09:15:14 am
Hi Lobo

Had a go and it works fine...but then the demo site is 4.5.1

I am wondering if it is because of the group structure and the fact that i have a single database driving multiple Drupal sites with common login. With this setup i am forced to have a 'parent group' for all groups normal or smart? I also had a few issues moving back from a multi language site to single language so this could be a cause.

I have been trying to avoid creating a new db but it is looking more and more likely.

Any suggestions...?

Robbie

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Re: Smart Group error when trying to create
October 09, 2014, 03:33:49 pm
You said that it didn't happen on the 4.5.1 demo site, have you tried upgrading to 4.5.1 today to see if it fixes the problem for you as well?
CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Re: Smart Group error when trying to create
October 10, 2014, 12:47:37 am
Hi Danc

Trying that now...fingers crossed.

Robbie

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Re: Smart Group error when trying to create
October 10, 2014, 05:16:22 am
Should I assume since you haven't posted back that it worked?
CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Re: Smart Group error when trying to create
October 11, 2014, 02:25:06 pm
Hi Danc

sorry, this is the first chance I got to work on this. Have now upgraded to 4.5.1 but still getting the same error when trying to save/update a smart group.

Fatal error: Cannot access protected property CRM_Contact_Form_Task_SaveSearch_Update::$_id in /.../sites/all/modules/civicrm/CRM/Group/Form/Edit.php on line 502

When I click on contacts/manage groups it also takes ages to load.

I'm stuck, any ideas?

Robbie

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Re: Smart Group error when trying to create
October 11, 2014, 02:38:55 pm
Basically this is the code that I have in my Edit.php file


    if (count($parentGroupSelectValues) > 1) {
      if (CRM_Core_Permission::isMultisiteEnabled()) {
        $required = empty($parentGroups) ? TRUE : FALSE;
        $required = (($obj->_id && CRM_Core_BAO_Domain::isDomainGroup($obj->_id)) ||
          !isset($obj->_id)
        ) ? FALSE : $required;
      }
      else {
        $required = FALSE;
      }
      $obj->add('select', 'parents', ts('Add Parent'), $parentGroupSelectValues, $required, array('class' => 'crm-select2'));
    }

    return $parentGroups;
  }
}
« Last Edit: October 11, 2014, 03:07:10 pm by robbiemc »

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Re: Smart Group error when trying to create
October 11, 2014, 03:20:38 pm
I don't have a multisite install to test on (and it didn't dawn on me until just now that you said you did and the demo isn't) so I can't test this on 4.5.1 right now to verify.  It will take me a couple days to set up a sample to test on, although I'm hoping someone who does use that functionality will chime in.

I do just want to be sure, do you have any custom code set up on your site?
CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Re: Smart Group error when trying to create
October 11, 2014, 11:52:09 pm
Hi Danc

We have some custom templates/ reports and an activity to allow us to send out certificates as pdf attachments. But nothing that I have to mess with during an upgrade.

Robbie

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Smart Group error when trying to create

This forum was archived on 2017-11-26.