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 CiviEvent (Moderator: Yashodha Chaku) »
  • "Select a valid contact" error on Contact Reference Custom Fields
Pages: [1]

Author Topic: "Select a valid contact" error on Contact Reference Custom Fields  (Read 1401 times)

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
"Select a valid contact" error on Contact Reference Custom Fields
August 02, 2010, 01:48:32 pm
I'm getting an error in 3.2 stable when using custom Contact Reference (autocomplete-select) fields.  No matter what contact I pick, I get the "Select a valid contact for ..." error on the form and cannot submit it.

Try here (there are two custom fields: Host and Referral - it complains on Host):
http://drupal.demo.civicrm.org/civicrm/event/add

Is this a bug a config issue on my end?

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: "Select a valid contact" error on Contact Reference Custom Fields
August 02, 2010, 02:12:21 pm
i just added a couple of randoms in there - eg adams, charles and adams, kenneth

and it seemed to work fine and saved etc see

http://drupal.demo.civicrm.org/civicrm/event/manage/eventInfo?reset=1&action=update&id=8

or have i completely missed your point?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: "Select a valid contact" error on Contact Reference Custom Fields
August 02, 2010, 02:40:04 pm
Peter - weird. Definitely did NOT save for me using demo or my local sandbox. I got "Select a valid contact for Referred By." Tried again after your post above and it worked on 2 attempts to save a contact w/ a custom contact reference field, then bombed again on the 3rd try :=(

Unfortunately it seems like the behavior is a bit inconsistent but there's definitely some problem. I've posted a bug report here:

http://issues.civicrm.org/jira/browse/CRM-6574
Protect your investment in CiviCRM by  becoming a Member!

damion

  • I’m new here
  • *
  • Posts: 16
  • Karma: 1
Re: "Select a valid contact" error on Contact Reference Custom Fields
August 25, 2010, 02:56:22 am
Seems like I've got the same problem, and after many hours, I could use help.  I've got Drupal 6, and Civicrm 3.1, and a custom auto-complete Contact Reference field in a CiviCRM Profile in a Contribution form for member signup.  I can edit a contact using this contact reference field no problem.  The problem CiviContribute form is at:

http://208.88.5.242/cms/civicrm/contribute/transact?reset=1&id=3

I can fill in the form and use the control (Workplace 1, which is custom_60 field; or Workplace 2, which is custom_65 field) to select a name/value.  CURRENTLY there's only one value to select: Learningpoint.  Press "Continue >>", and usually:

A) Makes it to confirmation page (read-only record except for hidden fields) with no apparent problem, BUT USING FIREBUG I CAN SEE hidden inputs for custom_60_id and custom_65_id have empty values?!?  Pressing "Continue >>" Progresses to B:

B) Returns back to same confirmation page, with CiviCRM error "Select a valid contact for Workplace 1.", same as for David.

SO If content reference field processing is depending on custom_60_id hidden field to pass the chosen id, this is where it is failing?

I've confirmed that on arrival (A) to confirmation page, the php _POST has appropriate custom_60_id value (14), and CiviCRM's own _submitValues[] array has it too.

Is there some CiviCRM / Drupal permission setting that might be causing the field's value to be stripped out?

Or is it that a bug exists in the Confirmation page processing that is preventing the field's value from being passed on?

Your suggestions much appreciated!

Damion
« Last Edit: August 25, 2010, 02:59:14 am by damion »

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: "Select a valid contact" error on Contact Reference Custom Fields
August 25, 2010, 07:23:09 am

if i had to guess this is a bug in contact reference field and profiles embedded in a contribution/event page

please file an issue and we'll try to fix for 3.3

If you are a developer you can help take a look at the code and figure out whats happening and submit a patch (which will help get it into a 3.2.x release). Contact us on IRC and we can help u get started

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

damion

  • I’m new here
  • *
  • Posts: 16
  • Karma: 1
Re: "Select a valid contact" error on Contact Reference Custom Fields
August 25, 2010, 11:31:27 am
Thanks, Lobo!

Damion

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: "Select a valid contact" error on Contact Reference Custom Fields
August 25, 2010, 11:40:21 am
Damion:

First you should upgrade to 3.2. We have fixed few issues related to Contact Reference in 3.2

Kurund
Found this reply helpful? Support CiviCRM

damion

  • I’m new here
  • *
  • Posts: 16
  • Karma: 1
Re: "Select a valid contact" error on Contact Reference Custom Fields
August 25, 2010, 12:22:07 pm
Ok, will try upgrade.  (I am a developer and in the middle of this project with deadline, so was trying to avoid variables like "upgrade" but now that starts to look like it would save time!).  If upgrade doesn't fix then I will go back to bug hunt, and will report results.

damion

  • I’m new here
  • *
  • Posts: 16
  • Karma: 1
Re: "Select a valid contact" error on Contact Reference Custom Fields
August 25, 2010, 02:53:02 pm
Ok, I upgraded to 3.2, but still same problem.  Above URL remains the test example.

On confirmation hidden fields have correct values. (Other required fields may trigger errors at this stage as is normal).

<input name="qfKey" value="b73f696d65ec15cd6ee8f4fc4fa0301e_3962" type="hidden">
<input name="contact_sub_type_hidden" value="Member" type="hidden">
<input id="custom_60_id" name="custom_60_id" value="14" type="hidden">
<input id="custom_65_id" name="custom_65_id" value="16" type="hidden">
<input name="_qf_default" value="Main:upload" type="hidden">
<input name="MAX_FILE_SIZE" value="10485760" type="hidden">

After pressing "Confirm Contribution" button I get error page, and, I see the hidden variables are empty: 

<input name="qfKey" value="b73f696d65ec15cd6ee8f4fc4fa0301e_7586" type="hidden">
<input name="contact_sub_type_hidden" value="Member" type="hidden">
<input id="custom_60_id" name="custom_60_id" value="" type="hidden">
<input id="custom_65_id" name="custom_65_id" value="" type="hidden">
<input name="_qf_default" value="Confirm:next" type="hidden">

Since form has values for <input id="cusotm_60" ...> etc, I presume this triggers error.

Interestingly, forgetting a required field causes only that error to be reported; its only after successful form validation that this "Select a valid contact" error pops up.

I'll start a bug report.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • "Select a valid contact" error on Contact Reference Custom Fields

This forum was archived on 2017-11-26.