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) »
  • Record activity for contacts not working with custom searches
Pages: [1]

Author Topic: Record activity for contacts not working with custom searches  (Read 456 times)

mlampard

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
Record activity for contacts not working with custom searches
February 02, 2011, 02:11:07 pm
Hi All,
Before I go on, I'm running CiviCRM version 3.1.4 on Drupal 6.17 - no chance of upgrading in the near future....

My custom searches have stopped working with the "Record activity for contacts" action. When I select users, select record activity... and hit Go, I get a PHP warning:
warning: Invalid argument supplied for foreach() in ......sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php on line 496.

This happens for ANY custom search, but no basic or advanced search. Here's what I have done and determined:
1. I hacked the controller file and added debug statements just above the offending line at 496.
2. The foreach loop references $data and $page (both arrays)
3. $data contains further arrays, one of which is the [values] array.
4. The [values] array also contains arrays, one of which is the [Basic] array when you do a basic or advanced search. When doing a custom search, this array is called [Custom]
5. $pages contains an array with key of 0 which has a value of "Basic", regardless of the type of search
6. So, the foreach ($data['values'][$page] as $key => $value) statement will obviously fail for custom searches, because it translates as foreach($data['values']['Basic']...) and 'Basic' does not exist in the values array for custom searches!

If the above is unclear, check the attachment, which is the output of the debug statement for a custom search

So, this used to work. Not sure about this version, as my client is uncertain as to whether they've tried running this action since I last upgraded for them. I suspect it might be some server "confusion" that a reboot may fix, but I don't have that luxury, as it's externally hosted. If I push them they may stop and restart services though....

Any thoughts anyone?
Cheers,
Marty.

« Last Edit: February 02, 2011, 02:13:00 pm by mlampard »

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: Record activity for contacts not working with custom searches
February 02, 2011, 03:58:54 pm

might want to try this on the demo machine (yes i know, latest version) and see if it works there.

If its broken there its a step forward (and u can potentially backport the fix when it is made)

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

mlampard

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 3
Re: Record activity for contacts not working with custom searches
February 02, 2011, 05:31:55 pm
Works fine on the demo 3.3 site.
Cheers,
Marty.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Record activity for contacts not working with custom searches

This forum was archived on 2017-11-26.