I update to the latest dev version posted and now I'm getting various errors:

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/.kumquat/tzpikes/tzpikes.com/pikeaccess/modules/site_user_list/site_user_list.module on line 700.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/.kumquat/tzpikes/tzpikes.com/pikeaccess/modules/site_user_list/site_user_list.module on line 699.
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/.kumquat/tzpikes/tzpikes.com/pikeaccess/modules/site_user_list/site_user_list.module on line 700.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/.kumquat/tzpikes/tzpikes.com/pikeaccess/modules/site_user_list/site_user_list.module on line 700.
* warning: implode() [function.implode]: Bad arguments. in /home/.kumquat/tzpikes/tzpikes.com/pikeaccess/modules/site_user_list/site_user_list.module on line 705.
* warning: implode() [function.implode]: Bad arguments. in /home/.kumquat/tzpikes/tzpikes.com/pikeaccess/modules/site_user_list/site_user_list.module on line 706.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE' at line 1 query: CREATE OR REPLACE VIEW site_user_list_view AS SELECT DISTINCT u.uid as `@uid`, t_1.value as `@profile_fullname`, t_2.value as `@profile_location`, u.mail as `@mail` FROM WHERE in /home/.kumquat/tzpikes/tzpikes.com/pikeaccess/includes/database.mysql.inc on line 172.

Comments

anonymous562’s picture

And yes, I did run update.php

pukku’s picture

Assigned: Unassigned » pukku

Hi! Can you tell me what the CVS id of site_user_list.module is? It should be on the second line of the file. I ask because the line numbers you've provided don't match the current version I have from CVS at all (you're at least 50 lines off from the closest call to array_merge()).

Also, do you have the devel module installed (I ask because if you do, then I can use the dpm and dprint_r functions to ask you to post some results; if you don't, we'll have to look at other ways to get data...).

Also, do you have either excluded_users or organizational infrastructure (oi) installed?

Ricky

Armithage’s picture

Hi,

I get somethin similar to this, when i try to install the latest(?) build.
CVS: $Id: site_user_list.module,v 1.1.2.6.2.21 2007/05/20 17:00:25 pukku Exp $

I'm running Drupal 5.1, PHP 5.1.4, MySQL 5.0.21 on a WinXP OS,
And this is the error message i get, when i try to activate this module:

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 698.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 699.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 700.
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 698.
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 699.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 699.
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 700.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 700.
* warning: implode() [function.implode]: Bad arguments. in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 704.
* warning: implode() [function.implode]: Bad arguments. in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 705.
* warning: implode() [function.implode]: Bad arguments. in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 706.

Armithage’s picture

Sorry for repost:

Also, do you have the devel module installed (I ask because if you do, then I can use the dpm and dprint_r functions to ask you to post some results; if you don't, we'll have to look at other ways to get data...).

Also, do you have either excluded_users or organizational infrastructure (oi) installed?

I've none of the listed modules installed.

pukku’s picture

Status: Active » Fixed

Hi! I think that this is a difference between PHP 4 and PHP 5 (I'm stuck on PHP 4 until I can fully replace some old code that doesn't work under PHP 5). The problem is that the hook_site_user_list_query_sql calls were returning empty arrays, and these weren't being sub-indexed properly (at least, I think this is the problem; I can't actually test this...). I've committed a partial fix to CVS by wrapping the return statements of profile_site_user_list_query_sql and user_site_user_list_query_sql with a check to make sure the $ret array has something in it. Can you please test this and see if it cuts down on the number of error messages? If this is the problem, then there is a better fix, but I want to make sure that I'm heading in the right direction...

Armithage’s picture

I'm now using:
.install // $Id: site_user_list.install,v 1.1.2.3.2.6 2007/05/21 13:17:28 pukku Exp $
.module // $Id: site_user_list.module,v 1.1.2.6.2.22 2007/05/21 13:17:28 pukku Exp $

The current errors that occurs if i try to active the module:

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 699.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 700.
* warning: implode() [function.implode]: Bad arguments. in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 705.
* warning: implode() [function.implode]: Bad arguments. in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 706.

pukku’s picture

Status: Fixed » Active

Hi! If you look at line 697–701, it should be a foreach loop. The loop looks like:

  foreach ($query as $m => $items) {
    $cols = array_merge($cols, $items['cols']);
    $joins = array_merge($joins, $items['joins']);
    $where = array_merge($where, $items['where']);
  }

could you replace that loop with this one:

  foreach ($query as $m => $items) {
    if (!empty($items['cols'])) {
      $cols = array_merge($cols, $items['cols']);
    }
    if (!empty($items['joins'])) {
      $joins = array_merge($joins, $items['joins']);
    }
    if (!empty($items['where'])) {
      $where = array_merge($where, $items['where']);
    }
  }

and let me know whether you get errors or not?

Thanks,
Ricky

Armithage’s picture

Done. That works.
At least the activation works fine for me now.
But now there are three other things:

  1. As default there are only the "view" and "edit" button displayed. That means that i have a table only filled with rows containing "edit" and "view" for every registered user, and have to active the other fields in the display option.. a little bit irritating
  2. none of the additional profile fields that i declared through the "profile" module is displayed.
  3. And the worst one: Using the search function causes following errors:

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 877.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 878.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 879.
* warning: implode() [function.implode]: Bad arguments. in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 885.

rgds,
Michael

pukku’s picture

Hi!

1. This is due to a bug in my .install file; I added a new type of column (hidden column), and provided an update function to make the display types all work, but forgot to update hook_install. I've committed this to CVS, so if you get a new .install file (cvs id: 1.1.2.3.2.6) from cvs, and _uninstall_ the module, then reinstall it, things will work file. Or, just run the query located in site_user_list_update_5().

2. Did you go to admin/settings/site_user_list/fields and enable the fields there, set to "display by default"?

3. These errors are caused by the same issue as the previous set (I knew they would come up, but I wanted to see if the fix I had was the correct one). I've just committed a version with this fixed, but if you don't want to grab the latest (cvs id: 1.1.2.6.2.23) from cvs, around line 876 there is another foreach loop, which you can replace with:

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

Ricky

pukku’s picture

(BTW: please let me know if this fixes everything... Thanks!)

Armithage’s picture

Hi,

1. works now like i want it to :)

2. my fault, sry.

3. i've grabed // $Id: site_user_list.module,v 1.1.2.6.2.23 2007/05/21 14:20:50 pukku Exp $ from CVS. The Loop around 876 looks exactly like you posted it, but using the find function still causes some errors:

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 881.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\xampplite\htdocs\drupal\sites\all\modules\site_user_list\site_user_list.module on line 884.

rgds,
Michael

pukku’s picture

Hm. It looks like array_merge got really picky in PHP 5.

Could you change line 1539 from:

        return array('profile' => array('where' => $or_clause, 'description' => $description));

to

        return array('profile' => array('where' => array($or_clause), 'description' => array($description)));

and let me know if that fixes the problems?

Thanks,
Ricky

Armithage’s picture

Done.

Everything works now without an error :)
Lot of thanks. If there's something to test furthermore, just say it ;)

rgds,
Michael

pukku’s picture

Cool! I will commit that last change...

Ricky

pukku’s picture

Status: Active » Fixed
anonymous562’s picture

I just downloaded the latest build that was posted on the main page development branch:
site_user_list.module,v 1.1.2.6.2.21 2007/05/20 17:00:25 pukku Exp $

I see this is not the latest version you have posted in the CVS. Forgive my incompetence -- I've never used CVS before, so I'm not sure if I should apply for an account and such, or just wait for the main page's link to reflect the newest version. How often is it updated?

pukku’s picture

Hi! I think the tarballs are re-built every eight hours or so. There's a complicated schedule posted somewhere, but I don't know it off hand.

If you can't wait the eight hours, applying for CVS access won't do you much good, because that takes longer. However, you can go to

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/site_user_lis...

and

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/site_user_lis...

to get the text of the latest .module and .install files. You could then copy the text out of these pages and replace the text currently in the .module and .install files...

Ricky

anonymous562’s picture

Excellent - it works now. Thanks so much for your help. You've done a great job, and I appreciate the prompt responses!

pukku’s picture

Status: Fixed » Closed (fixed)

Thanks! Glad to help!