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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Value Separator missing in custom ACL hook clause
Pages: [1]

Author Topic: Value Separator missing in custom ACL hook clause  (Read 814 times)

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Value Separator missing in custom ACL hook clause
July 11, 2013, 05:20:23 pm
I've just run into a problem with some custom ACL hook code that we are running.

Essentially, I am using a variation of the code on this page
http://wiki.civicrm.org/confluence/display/CRMDOC43/hook_civicrm_aclWhereClause

The offending piece of code:
Code: [Select]
if ( strpos( CRM_Core_DAO::VALUE_SEPARATOR, $dao->$field ) !== false ) {}
I have a custom field which is coming back in $dao->$field which is an Advanced Multi Select of 56 values. However, it isn't picking the the VALUE_SEPARATOR, and so it just sees it as a really long string '123456.........545556' instead of 1,2,3,4,5,6......54,55,56.

The custom field seems to be working fine from the GUI, so it seems that there is a value separator in there, otherwise Civi wouldn't be able to know which ones to put on either side of the multiselect box right?

Thanks!

Brian

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Re: Value Separator missing in custom ACL hook clause
July 17, 2013, 05:00:17 am
Worked around this. I removed this line, as for some reason strpos wasn't picking up the VALUE_SEPARATOR, but I could do a str_replace on it and it worked fine.

A little reorganization of the code, and its working although I am still stumped as to why it stopped working in the first place.

Brian

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Value Separator missing in custom ACL hook clause

This forum was archived on 2017-11-26.