Message seen at top of module page is
warning: preg_match() expects parameter 2 to be string, array given in /srv/www/htdocs/cnp/sites/all/modules/admin_menu/admin_menu.inc on line 244.

This occurs in fresh D6.10 installation when only these two modules activated. Does not occur with Devel 6.X-1.15.

I have posted it here because the error refers to admin_menu, but of course the problem might lie in Devel.

CommentFileSizeAuthor
#13 admin_menu.devel_.patch1.39 KBvgarvardt
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

VM’s picture

I can't reproduce this with 6.x-dev of the admin_menu.module

could you try the 6.x-dev and see if you can reproduce ?

Dave Reid’s picture

242 : 	  	  	 if ($devel_user_links = module_invoke('devel', 'switch_user_list')) {
243 : 	  	  	foreach ($devel_user_links as $link) {
244 : 	  	  	if (preg_match('!href="'. base_path() .'([^\?]+)\?([^"]+)" title="([^"]+)">((<em>)?[^<]+(</em>)?)!', $link, $match)) {

Make sure you're using the latest version of devel since it looks like this new feature was added in devel 6.16.
See #196671: Allow admin_menu to output switch_user list.

AFowle’s picture

@VeryMisunderstood
Admin_menu 6.x-1.x-dev of 2009-Apr-01 works with Devel 6.x-1.16.

@Dave Reid
Devel 6.x-1.16 is the latest AFAIK. I don't understand your reference to the other issue, which was recently reopened.

Is this a problem where two modules needed to be altered to achieve a change and only one of them has gone public?

DamienMcKenna’s picture

I've just hit this too - fresh install of Devel 6.x-1.6 and Admin Menu 6.x-1.3.

DamienMcKenna’s picture

One thing I noticed was that there were both system updates (updated from 6.9 to 6.10) and module updates pending.. after running the updates the error disappeared.

Ariesto’s picture

warning: preg_match() expects parameter 2 to be string, array given in /var/www/modules/admin_menu/admin_menu.inc on line 244.

I just hit the same error message. Occurred after I updated the Devel module, version devel-6.x-1.16.tar.

Dave Reid’s picture

Status: Active » Fixed

This has actually been fixed in the latest 6.x-1.x version of admin_menu since Mar 31. You will need to update from version 1.3 to the latest 6.x-1.x-dev to fix this error. Hopefully we can probably get a new release of admin_menu to match the new devel release.

See http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/admin_menu/...

Ariesto’s picture

Status: Fixed » Closed (fixed)

Yep, I just updated to the dev version and all is good. I like the latest 6.x-3.x-dev.tar!

m4manas’s picture

Thanx Guys i was wondering whether this error is because of any of my customs mods.

Dave Reid’s picture

Status: Closed (fixed) » Fixed

@Ariesto Please don't mark fixed issues as closed, so that other that have this problem can easily find this issue still.

Ariesto’s picture

@DaveReid, sorry about that, I forgot that the issue disappears as closed.

Dave Reid’s picture

Marked #433108: Wrong argument for preg_match() as a duplicate of this issue.

vgarvardt’s picture

FileSize
1.39 KB

Here is patch that solves the problem for me.

Dave Reid’s picture

@vgarvardt Please read the rest of this issue. It's already been fixed and you just need to update to the latest 6.x-1.x-dev version of admin_menu.

DamienMcKenna’s picture

@davereid: Are there any plans to release another v6.x-1.x release that would include this fix?

adrinux’s picture

Just ran into this one too. I can confirm that upgrading to 6.x-1.x-dev fixes this bug. Unfortunately it has it's own problems (it's putting all the switch user links in with the rest of the main menu, wipe & rebuild, clear cache etc doesn't seem to help).

@Ariesto how stable/useful is 6.x-3.x-dev?

And what happened to 2.x?

VM’s picture

6.x-3.x works fine for me, I've been using it and keeping it updated for awhile now.

EmanueleQuinto’s picture

Marked #431186: preg_match() expects parameter 2 to be string as a duplicate of this issue.

#13 works for me

Ariesto’s picture

@adrinux, check here for my experience with the 6.x-3.x-dev

http://drupal.org/node/431202#comment-1484878

Mark Theunissen’s picture

Confirm problems in #16 - it adds all the user names into the top level of the menu.

sun’s picture

Last mentioned bug in 1.3 has been fixed now. A new development snapshot for 1.x will be available within the next 12 hours.

fcedillo’s picture

all user names are added in the top level of the menu (as said in #16 and #20) , it will be fixed too?

adrinux’s picture

@AdagioParaCuerdas Yes, it's all fixed in 1.x-dev as sun says, update and enjoy.

fcedillo’s picture

Thank you @adrinux and thanks to @sun :) I am enjoying it right now :)

ObiWasabi’s picture

I've run into this problem "warning: preg_match() expects parameter 2 to be string" again with 6.10 DRUPAL Install &

admin_menu-6.x-1.3
devel-6.x-1.16.

Mark Theunissen’s picture

@ObiWasabi: use the 6.x-1.x DEV version where the bug is fixed.

lentreprenaute’s picture

Status: Fixed » Active

Excuse my english.

I made a fresh install "today" with lasted version drupal 6.10 and lasted version admin menu 6.x-1.3 + devel 6.x-1.16.

Devel create this error. I uninstalled it and the error was still here, i removed and reinstalled admin menu to fix this error that i all the time when i called admin/module/list. it's create a other pb with memory_size, not expert but it seems to be link.

Florent

Mark Theunissen’s picture

Status: Active » Fixed

The bug is in version 1.3. If you use version 1.3, you will see this error.

The bug is fixed in version 6.x-1.x-dev which is the development package with the latest changes to the code. Please try that and report back if it still doesn't work for you.

http://ftp.drupal.org/files/projects/admin_menu-6.x-1.x-dev.tar.gz

pvhee’s picture

When will it be committed to the stable version? All my updated sites are getting this warning, and I would not like to roll out with the dev version of the module. Thanks.

Harry Slaughter’s picture

admin_menu-6.x-3.x-dev seems to have fixed this problem for me.

seanr’s picture

Would it be too much to ask to get a new point release out (i.e. 6.x-1.4)? Drush automatically downloads the latest recommended release by default and most non-expert users downloading manually from the project page are going to download that as well normally, so you'll keep ending up with lots of people complaining here until you roll out a regular release. ;-)

logicalpat’s picture

I agree, we could really use this fix in a regular stable release.

OldAccount’s picture

Installing admin_menu-6.x-3.x-dev seems to have fixed this problem for me as well, but I had to run update.php afterwards to clear up the whole new list of errors about missing tables (cache_admin_menu) I started getting after the update.

I'm new to Drupal so I usually forget to do this when I update modules, thought I'd mention it for others.

seanr’s picture

Title: Error in Admin_Menu 6.x-1.3 with Devel 6.x-1.16 » Create release for Error in Admin_Menu 6.x-1.3 with Devel 6.x-1.16
Category: bug » task
Status: Fixed » Active

Changing this to a task and reopening. I'm not particularly keen on switching to the dev version on production sites, and PHP errors on production sites really isn't too great either. ;-)

sun’s picture

Status: Active » Fixed
sun’s picture

Status: Fixed » Closed (fixed)
Cyn’s picture

Status: Closed (fixed) » Needs review

Hello all,

I have hit the same problem, when I add Devel module, I get the following error at several places, e.g. administrating modules:
"warning: preg_match() expects parameter 2 to be string,
array given in /etc/drupal/6/sites/all/modules/admin_menu/admin_menu.inc on line 244"

As far as I understand there was a compatiblity issue with Administration menu and Devel modules. I have the following versions (note that when deploying Devel I get the four next modules shown as well under the Development category)

Administration menu 6.x-1.3

Devel 6.x-1.18
Devel generate 6.x-1.18
Devel node access 6.x-1.18
Performance Logging 6.x-1.18
Theme developer 6.x-1.18

The Devel latest stable release (6.x-1.18) is more recent than the stated errors (see #26, April). Do I still need to go to the dev version? Am I doing something wrong?

I am changing Status to 'needs review'. I hope this is appropriate.

Any help is greatly welcome.
Alex @ www.cynertiaconsulting.com

Dave Reid’s picture

Status: Needs review » Fixed

@Cyn: The latest version of admin_menu is 6.x-1.5. Make sure you are always using the latest versions.

sun’s picture

Status: Fixed » Closed (fixed)