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 Profiles (Moderator: Dave Greenberg) »
  • Contact Reference Custom Data Field Not Working for Anonymous Users
Pages: [1]

Author Topic: Contact Reference Custom Data Field Not Working for Anonymous Users  (Read 1377 times)

nessnzoe

  • I post occasionally
  • **
  • Posts: 84
  • Karma: 2
    • GingerFeet LLC
  • CiviCRM version: 3.4.8
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.14
  • PHP version: 5.3.6
Contact Reference Custom Data Field Not Working for Anonymous Users
July 29, 2011, 03:42:02 pm
Hi all,

I apologize if I've already asked about this, but I can't find it anywhere on the forum.

We've been trying for months now to create profiles that contain contact reference custom data fields (so that anonymous users can select the organizations that they are connected to) and they just don't seem to work. At least not for us!

Whenever we include a profile that has this contact reference custom data field, and try to fill out the form as an anonymous user, there is:
  • no magnifying glass icon in the right of the field and no contact drop-down appears. And...
  • even though we can enter data into the field, upon submission, CiviCRM returns an error that we have to select something from the database...which we can't.
 
Can contact reference fields be used on the front-end of the website for anonymous users? Are we trying to do something that's just not do-able?

We thought it might be a permissions problem. Here are our permission setting for the anonymous user role in Drupal:

access CiviEvent
access CiviMail subscribe/unsubscribe pages
access all custom data
profile listings
profile listings and forms
profile view
register for events
view event info

Any thoughts?

Many thanks,
Vanessa

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: Contact Reference Custom Data Field Not Working for Anonymous Users
July 29, 2011, 06:39:04 pm
HI Vanessa - have you confirmed how it works on Demo? Set up a profile same as on your system, then logout and give it a whirl
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

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: Contact Reference Custom Data Field Not Working for Anonymous Users
July 30, 2011, 04:08:05 am
Quote from: nessnzoe on July 29, 2011, 03:42:02 pm
Can contact reference fields be used on the front-end of the website for anonymous users? Are we trying to do something that's just not do-able?

I'm pretty sure its currently not doable in the current versions. primarily this exposes all contact names to the world and as such is a potential security risk.

You might be able to make it work by using the ContactListAlter hook

there is an MIH which will allow contact references to be restricted by group:

http://civicrm.org/mih#contactref

If we have enough time with that MIH we'll consider adding support to "expose" it to non-auth users. However it is currently not part of that MIH

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

nessnzoe

  • I post occasionally
  • **
  • Posts: 84
  • Karma: 2
    • GingerFeet LLC
  • CiviCRM version: 3.4.8
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.14
  • PHP version: 5.3.6
Re: Contact Reference Custom Data Field Not Working for Anonymous Users
August 01, 2011, 11:04:40 am
Thanks guys.

Pete: Attempting this on demo had a bit better results in that the contact reference field had the search icon and appeared to be trying to find the org. But it never does find the record and if you type something in and save it returns the error:

"Please correct the following errors in the form fields below:
Select a valid contact for Name of the Organization."

So Lobo...I think you hit the nail on the head! And it's totally understandable that it exposes the whole DB so isn't wise to include for anonymous users. We'll use a custom data field that is a simple text field.

Thanks for all the time you guys spend helping folks like me. You have no idea how appreciated it is!
All the best,
Vanessa

dschafer

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 3
    • Backoffice Thinking
  • CiviCRM version: 3.2.3 - 4.4.4
  • CMS version: Drupal 6.x, 7.x, Wordpress
  • MySQL version: 5.1.x - 5.5.x
  • PHP version: 5.2.x - 5.4.x
Re: Contact Reference Custom Data Field Not Working for Anonymous Users
August 10, 2011, 01:02:18 pm
We're having a similar issue except when the user is editing a custom data group.

Is there a specific permission or combination that the user must have for contact reference to work?

We have certain users who are only permitted to edit certain contacts. We control this through ACL and the permission flag on relationship.

The users have the following permissions: (we're not concerned that they can see contacts outside their group only editing them)

access CiviCRM
access Contact Dashboard
access all custom data
view all contacts   
view all notes   

The current behavior is the same as Vanessa described.

Thanks

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: Contact Reference Custom Data Field Not Working for Anonymous Users
August 10, 2011, 03:24:51 pm

Dave:

Could you debug the XHR call generated by the contact reference and see whats happening. If the user does have "view all contacts", they should be able to see all the contacts in the dropdown

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Contact Reference Custom Data Field Not Working for Anonymous Users

This forum was archived on 2017-11-26.