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) »
  • Integer Radio field with value 0 breaks Advanced Search
Pages: [1]

Author Topic: Integer Radio field with value 0 breaks Advanced Search  (Read 1078 times)

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Integer Radio field with value 0 breaks Advanced Search
June 09, 2009, 09:06:58 am
Hi,

I've replicated the following problem on demo, with the "Checkbox Test" custom group. It also occurred on a client's site running Civi 2.2.5 .

(1) Create custom group for Contacts with some "Yes or No" fields (Young, Free and Single in my example) and an Integer Radio field with two options, having values 0 and 1 (Liar in my example.). All fields searchable.
(2) Create some data for the "Yes or No" fields.
(3) In Advanced Search -> Custom Fields, select Yes for one of the "Yes or No" fields and click Search.
(4a) Above results, expand Search Criteria.
=> the 0 option for the Integer Radio field is now incorrectly set, in addition to the "Yes or No" field.

Other manifestations: after (1) to (3) above,

(4b) Select All X Records, choose Mailing Labels, hit Go, select label, uncheck Do not print..., click Make Mailing Labels.
=> Empty sheet produced, even though search returns results.
I suspect in this case the Integer Radio field is being included in the query generating the labels.

(4c) Select All X Records, choose Export Contacts, hit Go, Export PRIMARY fields, Continue.
=> I got a .csv containing all records from the demo db. In our client's example, they got a subset of the desired records, apparently those where the Integer Radio field was 0.
(5c) On clicking Cancel after completeing the export, on demo I got this warning:
"warning: Invalid argument supplied for foreach() in /var/www/drupal-6.civicrm.org/public/sites/drupal.demo.civicrm.org/modules/civicrm/CRM/Export/BAO/Export.php on line 195."
On the client's site, there was no error but the qill showed the Integer Radio field (= 0) in addition to the "Yes or No" field, which is what alerted me to the underlying cause of their export misbehaving.

Maybe related to CRM-3186 (Member search selects option value=0 for custom field even if it is not the default value) ?

Dave J

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Integer Radio field with value 0 breaks Advanced Search
June 09, 2009, 09:20:15 am
davej :

Can you file an issue for this in JIRA

Thanks for catching this
-Yashodha
« Last Edit: June 09, 2009, 09:22:24 am by Yashodha Chaku »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: Integer Radio field with value 0 breaks Advanced Search
June 10, 2009, 02:20:17 am
Quote from: Yashodha Chaku on June 09, 2009, 09:20:15 am
Can you file an issue for this in JIRA

Thanks for catching this

Done: CRM-4601

Thanks,

Dave J

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Integer Radio field with value 0 breaks Advanced Search
June 15, 2009, 12:51:49 am
Issue is fixed and code will be part of next stable release ( v2.2.6  :) )

you might want to take a look for patch

thanks
kiran
You Are Designed To Choose... Defined By Choice.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Integer Radio field with value 0 breaks Advanced Search

This forum was archived on 2017-11-26.