Hi,

I've just installed Drupal and downloaded the most recent module versions. I get this warning on the top of Content Types page.

"warning: Parameter 1 to admin_menu_admin_menu() expected to be a reference, value given in .../Sites/drupal/includes/module.inc on line 483."

how can I fix it
thanks

Edited by: VM; Moved to appropriate forum

Comments

vm’s picture

most recent version doesn't always help. Please state exact version of admin_menu module in use.

I'd disable, use the uninstall tab to remove it and reenable it.

aneuryzma’s picture

; $Id: admin_menu.info,v 1.5.2.1 2008/11/30 12:50:36 sun Exp $
name = Administration menu
description = Provides a dropdown menu to most administrative tasks and other common destinations (to users with the proper permissions).
package = Administration
core = 6.x

; Information added by drupal.org packaging script on 2009-07-02
version = "6.x-1.5"
core = "6.x"
project = "admin_menu"
datestamp = "1246537502"

vm’s picture

Beyond uninstalling and reinstalling not sure what else I can tell you.

I use 3.x alpha 1 and don't have this error.

yosisays’s picture

I get this error also :

warning: Parameter 2 to user_relationship_blocks_user_relationships_type() expected to be a reference, value given in C:\wamp\www\drupal\includes\module.inc on line 483.

vm’s picture

That error has nothing to do with admin_menu and looks to be coming from the user_relationships module

level09’s picture

Yes, this error appears on a fresh install of D 6.15, admin_menu .
it is caused by PHP version 5.3+

hayskelly’s picture

So I guess there is no known solution yet?

vm’s picture

nope Drupal 6.x isn't PHP 5.3 ready nor are most of the modules.

Drupal 7.x is the first version to run on PHP 5.2 and higher see: http://drupal.org/requirements

AdrianB’s picture

Drupal core is sort of ready for PHP 5.3 since 6.14 according to the requirements page:

PHP 5.3 is not yet supported by Drupal 5.x, but is supported by Drupal 6.14 core and higher (see the release notes for 6.14) and also by Drupal 7.x. Note that some contributed modules may not be compatible with PHP 5.3, and that some PHP 5.3 configurations still show warnings with Drupal 6.14;

marxman’s picture

Thanks level09, I'm running Wampserver 2.i which has PHP 5.3 as default. By reverting back to PHP 5.2.11 this issue was resolved as well, and does not involve hacking files.

AdrianB’s picture

In Administration menu 6.x-1.5, I god rid of this error by removing the & from line 107 in admin_menu/admin_menu.inc, from:

function admin_menu_admin_menu(&$deleted) {

to:

function admin_menu_admin_menu($deleted) {

mtpappas’s picture

...I'm a newbie.

AdrianB’s picture

As I said, it is on line 107 in the file admin_menu.inc in the admin_menu module folder.

Find your modules folder (usually sites/all/modules/) and then the admin_menu folder and then edit the admin_menu.inc file on line 107.

Hacking a module like this is usually not recommended, since it wont last past next update of the module, but for fast solutions to critical errors it may be the only way.

mtpappas’s picture

I appreciate you taking the time to help out. I didn't get where to find the file to change line 107.

As to hacking for a quick fix, can I just update the module as normal or will I still get the same message?

I ask this because as a novice I figure that if an issue is brought up enough times to the Drupal community, someone finds the answer and shows everyone else. Further, that this info is then included in futures updates. Am I wrong in this assumption?

Again thanks for your help.

AdrianB’s picture

I ask this because as a novice I figure that if an issue is brought up enough times to the Drupal community, someone finds the answer and shows everyone else. Further, that this info is then included in futures updates. Am I wrong in this assumption?

Bringing it up many times is not necessarily enough. If there is a problem with at module, in this case the Administration menu, then the proper way is to open an issue for that module. But before that, search through existing issues since it's more than likely that someone else already has opened an issue.

If a solution to the problem is found then someone has to create a patch, the patch has to be tested and then the module maintainer has to commit that patch. When it's committed the fix is usually in the -dev version of the module until the maintainer releases an new official ("stable") release of the module.

In this case there's already an issue for this problem: #615058: Parameter 1 to admin_menu_admin_menu() expected to be a reference

This issue contains a patch that was tested and committed by the maintainer. That means that the 6.x-1.x-dev version of the Administration menu contains this fix and therefore you can upgrade to that version and this problem will be solved without hacking the module any more.

Unfortunately the maintainer, sun, says that they won't release a new official release of Administration menu. That means you will have to use the -dev version and in this case that is ok, but as a newbie it is usually better to stick with official releases since -dev version can be broken and unstable.

But you will soon learn that some maintainers never releases official version and then the -dev versions is the only option. Although Drupal 7 is closing in there are still popular modules for Drupal 6 that's only available in -dev versions. Or, as in this case, the -dev version contains important bug fixes that the official release lacks.

eddy_vdgpajottenland’s picture

Many many thanks

Anonymous’s picture

Worked for me, thank you for posting this.

Larry0788’s picture

Thank you for your help with changing the line 107. It worked!!!!!!!

fausty’s picture

thanks it works well

shok’s picture

Tnx a lot bro, that worked for me!

kolossus’s picture

removing the ampersand does work

trebax’s picture

hi all,
i have also the same problem and i remove also the & on line 107 to fix the error message,
but unfortunately the error message doesn't stay not in connection with my primary problem :P

The admin menu doesn't list all menu items. For example the "create content"-link.
Do you have also a solution to this problem? Stand this problem also in connection with php5.3 - i need a quick fix ^^

krisjansen’s picture

I removed all &$ in admin_menu.inc and everything is solved overhere:
* line 107 function admin_menu_admin_menu(&$deleted)
* line 298 function admin_menu_adjust_items(&$menu_links, &$sort)
* line 418 function _admin_menu_devel_settings_form_alter(&$form, $form_state)

Even the create content link reappears in the menu

semperos’s picture

Folks should be careful when removing ampersands from function calls and definitions.

It means parameters are passed in by reference, and removing them could cause havoc.

In the above example, hook_form_alter expects to be able to alter the form, which is why $form is passed in by reference. It's the entire point of the hook.

ayalsule’s picture

function admin_menu_admin_menu($deleted) {

worked

...

ashhishhh’s picture

in admin_menu 1.6, they have fixed this

r.zamora@bbk.ac.uk’s picture

AdrianB's hack worked for me, many thanks