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) »
  • UpdateGreeting.php has no effect
Pages: [1]

Author Topic: UpdateGreeting.php has no effect  (Read 843 times)

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
UpdateGreeting.php has no effect
February 28, 2010, 08:18:02 pm
Subject kind of says it all.  Except that the full result is: "Greeting is updated for contact(s). (Done)".

I've been mucking about in the code on my test server, and I am pretty sure this is a simple typo/bug.  But because I don't really understand the code ("mucking about" being my phrase for trying to learn stuff), I'd like it someone confirmed this before I go posting a patch in the issues queue.

I think the SQL statement on line 131:

SELECT DISTINCT id
  FROM civicrm_contact
 WHERE contact_type = %1
   AND {$idFldName} IS NOT NULL

should be:

SELECT DISTINCT id
  FROM civicrm_contact
 WHERE contact_type = %1
   AND {$idFldName} IS NULL

Basically it looks like the script was only trying to update greetings that didn't need it. 

Am I correct here?

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: UpdateGreeting.php has no effect
March 01, 2010, 03:03:56 am
Quote
SELECT DISTINCT id
  FROM civicrm_contact
 WHERE contact_type = %1
   AND {$idFldName} IS NOT NULL

This is correct SQL. This will select contacts whose greeting type is already set. This SQL is called if url does not have force=1, which means update contacts whose greeting type is set. If you pass force = 1 then it will update all contacts in your db.

HTh
Kurund

Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • UpdateGreeting.php has no effect

This forum was archived on 2017-11-26.