Download & Extend

warning when doing search by OI Entities

Project:Site User List
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:pukku
Status:active

Issue Summary

I got the following warnings when doing search by specifying an OI Entity.

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/zee/public_html/drupal/modules/site_user_list/site_user_list.module on line 892.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/zee/public_html/drupal/modules/site_user_list/site_user_list.module on line 895.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/zee/public_html/drupal/modules/site_user_list/site_user_list.module on line 898.
* warning: implode() [function.implode]: Bad arguments. in /home/zee/public_html/drupal/modules/site_user_list/site_user_list.module on line 905.

Comments

#1

I found the problem, it was because sometimes you got $module_restrictions['blahblah'] as an array, and sometimes as a string. And so far the only case where it appears as a string is when the restrictions are enforced by OI. So I guess it's safer to do a test before you append the values for now. But it might be a bug in OI that you want to take a look at.

Here's the solution, replace the whole foreach code block starting from line 890 in site_user_list.module with the following:

  foreach ($restrictions as $module => $module_restrictions) {
    if (!empty($module_restrictions['joins'])) {
      if (is_array($module_restrictions['joins']))
        $joins = array_merge($joins, $module_restrictions['joins']);
      else
        array_push($joins, $module_restrictions['joins']);
    }
    if (!empty($module_restrictions['where'])) {
    if (is_array($module_restrictions['where']))
        $where = array_merge($where, $module_restrictions['where']);
      else
        array_push($where, $module_restrictions['where']);
    }
    if (!empty($module_restrictions['description'])) {
    if (is_array($module_restrictions['description']))
        $descriptions = array_merge($descriptions, $module_restrictions['description']);
      else
        array_push($descriptions, $module_restrictions['description']);
    }
  }

#2

Assigned to:Anonymous» pukku

Hi! What version of OI are you using (ie, the CVS id). Also, what version of PHP?

Thanks,
Ricky

nobody click here