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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • UpdateGreeting when overrides exist
Pages: [1]

Author Topic: UpdateGreeting when overrides exist  (Read 721 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
UpdateGreeting when overrides exist
May 10, 2011, 01:33:38 am
when I run the bin/UpdateGreeting.php script, I'm getting:
Fatal error: Cannot redeclare class CRM_Contact_BAO_Query

I traced it, and the problem is that I have an override copy of that file. it appears that the mere presence of an override file breaks the UpdateGreeting script. if I remove the override it runs fine. if I revert the override to the core version, it still errors (so its not the result of my modifications).

I'm guessing that the script is first calling the non-override version, and then later the override version, thus causing the class redeclaration. but i don't see where that might be happening in the script.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

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: UpdateGreeting when overrides exist
May 10, 2011, 06:45:07 am

can u try this patch:

Code: [Select]
svn diff bin/UpdateGreeting.php
Index: bin/UpdateGreeting.php
===================================================================
--- bin/UpdateGreeting.php      (revision 34210)
+++ bin/UpdateGreeting.php      (working copy)
@@ -46,6 +46,10 @@
 
         $config = CRM_Core_Config::singleton();
 
+        require_once 'CRM/Utils/Request.php';
+        require_once 'CRM/Core/PseudoConstant.php';
+        require_once 'CRM/Contact/BAO/Contact.php';
+
         // this does not return on failure
         CRM_Utils_System::authenticateScript( true );
 
@@ -57,9 +61,6 @@
     {
         require_once '../civicrm.config.php';
         require_once 'CRM/Core/Config.php';
-        require_once 'CRM/Utils/Request.php';
-        require_once 'CRM/Core/PseudoConstant.php';
-        require_once 'CRM/Contact/BAO/Contact.php';
     }
     
     public function updateGreeting( )

if it does work, can you please file an issue and we'll fix for 3.4.1

thanx

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

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: UpdateGreeting when overrides exist
May 11, 2011, 07:33:49 am
lobo -
patch works. filed issue:
http://issues.civicrm.org/jira/browse/CRM-8076
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • UpdateGreeting when overrides exist

This forum was archived on 2017-11-26.