Every time I try to save an edit to an existing bookmark, I get the following error:

warning: array_merge() [function.array-merge]: Argument #1 is not an array in C:\Inetpub\wwwroot\includes\menu.inc on line 351.

System:
Win2000 SP4
Apache/2.0.48 (Win32)
PHP/5.0.0
MySQL 4.0.13
bookmarks.module dated 02/02/2006 (downloaded 3/24/2006)

Comments

agentrickard’s picture

Status: Active » Needs review

This is a known PHP5 issue and has been filed previously. http://drupal.org/node/43543

The fix is to add 'callback arguments' to the menu function. Since this is currently blank, PHP5 (which is VERY strict on arrays) gives your error.

Code is below, pending review:

function bookmarks_menu($may_cache) {
  global $user;
  $items = array();
  $access = user_access('access bookmarks');
  
  // Main menu item
  $items[] = array('path' => "bookmarks/$user->uid", 'title' => t('my bookmarks'),
                    'callback' => 'bookmarks_page', 'access' => $access,
                    'callback arguments' => array('delete', 'edit' ));
                    
  // Top level tabs
  $items[] = array('path' => "bookmarks/$user->uid/overview", 'title' => t('list'),
    'access' => $access, 'weight' => -10, 'type' => MENU_DEFAULT_LOCAL_TASK);
  $items[] = array('path' => "bookmarks/$user->uid/add", 'title' => t('add bookmark'),
    'callback' => 'bookmarks_page', 'access' => $access, 'weight' => 10,
    'callback arguments' => array('quick'),
    'type' => MENU_LOCAL_TASK);

  return $items;
}
Steve Simms’s picture

Status: Needs review » Closed (fixed)

Hi,

I just took over maintainership of this module, and am going through all the open issues.

I don't have PHP5, so I can't reproduce this. However, this doesn't seem to be a bookmarks bug to me. The documentation says that callback arguments are "an array of arguments to pass to the callback function", which the module doesn't use, so we shouldn't have to specify it, unless I'm missing something (quite possible -- please enlighten me if so).

Are you still getting the problem with the latest version of Drupal? If so, and if you do think that this is a bookmarks bug, please reopen and give more details.

Thanks,
Steve Simms