The message in the title is the message that I receive when attempting to add someone to a buddylist. I'm on a clean install of Drupal 4.7. I started out using the 4.7 version of the module, saw the problem, then tried the CVS version and I'm seeing the same issue.

Assistance with this is greatly appreciated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

awakenedvoice’s picture

More information. Here's the error that I'm getting in the logs:

Missing argument 1 for buddylist_addbuddy() in /modules/buddylist/buddylist.module on line 713

AjK’s picture

there does appear to be some "mangling" going on with the url being encoded (I often see it trying to add the wrong buddy) but I'm out of time today (well, this afternoon anyway). I'll take a look later unless someone else beats me to it ;)

best regards
--AjK

awakenedvoice’s picture

I completely understand. Whenever you get a few moments a quick review would be helpful.

AjK’s picture

podcastnyc,

At the top of the buddylist.module file you'll see the file version number. I was using 1.58 and before I decided to delve into the problem I did a CVS update. I now have version 1.60 and for me at least the problem has gone away.

It looks like the transition from 1.58 to 1.59 fixed http://drupal.org/node/56696 which may be the fault you are experiencing.

So, before we go any further lets check your version and take it from there. A simple upgrade may solve your problem.

best regards
--AjK

awakenedvoice’s picture

Thanks. I'm going to put implementation of the Buddylist on hold for a couple of days as I'm tackling some other things. I will reply here when I get the new version installed and tested. Thanks.

Rob
Podcast NYC

pcwick’s picture

Version: 4.7.x-1.x-dev » master

PHP Version 5.1.2
MySQL - 5.0.18
Drupal 4.7 (Fresh Installation)
Buddylist 1.60

The buddy list module directory is in the modules directory, and the module has been activated. The install script created three database tables:

buddylist
buddylist_buddy_group
buddylist_groups

I began with the 4.7 version of the buddylist module (1.58 I think) and had the following problems so I switched to the cvs version of the module (1.60) and am still having the following problems.

On pages that display nodes and user pages I get this error:

Warning: Unknown column 'b.uid' in 'on clause' query: SELECT b.uid, g.label FROM buddylist b, buddylist_groups g INNER JOIN users u ON b.uid = u.uid WHERE b.buddy = 1 in drupal47/includes/database.mysql.inc on line 120

I made the change to buddy_access.module in this post http://drupal.org/node/58616, which seemed to correct that error.

Now, when I click on an "Add User To My Buddlist" link, I get these errors:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in drupal47/includes/menu.inc on line 415

Warning: Missing argument 1 for buddylist_addbuddy() in drupal47/modules/buddylist/buddylist.module on line 713

And on the "add to buddylist" page I get this message: "This user does not exist"

robertDouglass’s picture

looking into it.

piersonr’s picture

I am also getting the same errors (line 415/713) listed in comment 6. I've tried both the CVS and current 4.7 version of the module. Thank you, btw, to the developers of this module - this module is a GREAT idea!

windie’s picture

I had the same problem so i installed an old cvs version and it now works!
i had luck with Revision 1.48.2.9 but im not sure if others work.
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/buddylist/bud...
hopefully that helps, this is my first post on here.

greggles’s picture

Version: master » 4.7.x-1.x-dev
Status: Active » Needs review
FileSize
1.71 KB

Here's a patch that implements the combined advice of webchick and arava_phani in http://drupal.org/node/55230#comment-104472

This patch worked for me on php5. It is against the 4.7 version of the code, but may apply to CVS as well. Having seen these bugs before it seems to be mostly a PHP5 problem.

I don't know that this is the "right way" to fix it, but it worked for me.

pcwick’s picture

greggles patch, buddylist_merg.patch (1.71 KB), seems to have resolved the array_merge error. Thanks !!

robertDouglass’s picture

Ok, thanks for the patch, and thanks for the review. I'll try to get to this asap.

quicksketch’s picture

FileSize
1.97 KB

Thanks greggles for finding the problem! I've committed this change with a small difference: I didn't include any callback arguments at all, since if no arguments are specified the menu.module defaults to sending all the arguments following the menu path anyway. So in this case the path is "user/add" and the complete request could be "user/add/3". The callback function automatically receives '3' as its first parameter. If the path were "user/add/3/test/etc", the callback fuction would receive three arguments ('3','test','etc'). See the attached patch for more explanation.

quicksketch’s picture

Status: Needs review » Fixed
datura-1’s picture

Title: The User Does Not Exist » callback_arguments should be an array

Just a comment for those playing along at home.

If you look at the documentation of hook_menu here: http://api.drupal.org/api/HEAD/function/hook_menu

You'll see that callback_arguments should be "An array of arguments to pass to the callback function.". Instead, a scalar was being set and thus causing the error with array_merge in menu.inc, line 415.

But, the patch to remove the callback_arguments entirely seems even simpler, so nice work on that...

Justin

Anonymous’s picture

Status: Fixed » Closed (fixed)