warning: preg_match() expects parameter 2 to be string, array given in .../bootstrap.inc on line 718

bedge - February 20, 2008 - 07:14
Project:Wishlist Module
Version:6.x-2.1-beta
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Following errors show up after creating a couple of wish lists.

warning: preg_match() expects parameter 2 to be string, array given in
/mnt/md0/drupal/drupal-6.0/includes/bootstrap.inc on line 718.
warning: preg_match() expects parameter 2 to be string, array given in /mnt/md0/drupal/drupal-6.0/includes/bootstrap.inc on line 718.

#1

zilla - February 25, 2008 - 16:59

yikes - i was about to install and test on a d6 site - and i know that scott is busy with his kids and life ;) - but any resolve on this? any ideas?

#2

scott.mclewin - February 25, 2008 - 19:22
Status:active» postponed (maintainer needs more info)

Hum...that is certainly not a good message. Just looking at the D6 code that seems to be coming from a call to check_plain() with no parameter or perhaps an empty parameter.

I understand that it began to show up when you entered wishlist items, and I am not saying that it isn't the wishlist module, but something that broad could be any module.

Can you pin this down further? Is it on loads of specific pages? Are all of those pages wishlist related, or just some? Have you turned on more aggressive warning reporting at your PHP layer? Please post a stack trace if at all possible.

@zilla - in the end it is a warning, not an error, and because of where it is the net result is no change in behavior to the program. If nothing is passed into check_plain(), which is the root cause of the problem, then nothing will come out either, which is perfectly fine. Don't hesitate to install and test on a D6 site.

#3

zilla - February 25, 2008 - 19:52

thanks. i plan to. and btw, i totally agree - just went through the same thing emailing back and forth with a dev about a theme that was not displaying polls in drupal6 and after three days i found out that it was bug with an image module filtering into nodes and nothing to do with the theme...so in this case it might very well be another module or site settings. i'm on mediatemple with awesome log access, so if i see a similar bug i'll try to pull details as well...

#4

zilla - February 25, 2008 - 21:46

installed, it was working fine, created a few wishlists, added multiple items, logged in and out of 2 test accounts and then bam, saw that error:

warning: preg_match() expects parameter 2 to be string, array given in /home/514/domains/lexingtown.com/html/includes/bootstrap.inc on line 718.

*this did not happen until after i clicked on the wishlist configuration from admin page and changed a few variables (number of items to display, content to display to user for submission (which doesn't work btw, or at least i couldn't see it) and remove url column from summary view...

disabled for now...not sure what it is. not sure what module it may conflict with if that's the issue...

the error - for me - ONLY appears when i actually click to view a user's wishlist - so i can see wishlist page, then i click on a user and it gives the error up top BUT still works (i can get an item etc, and it updates properly and all of that...strange)

#5

NancyDru - February 28, 2008 - 18:18

If it helps you feel any better, I get this error and don't even have the Wishlist module. http://drupal.org/node/225211

#6

scott.mclewin - February 29, 2008 - 05:59
Priority:normal» minor

@zilla - if you do development on a local system where you have full access I would appreciate having a stack trace leading up to that warning.

@nancyw - Given where the warning is generated I'm not surprised. I may yet have a problem, but finding it could be rough. :)

I'll reiterate that this issue won't cause any problem with the actual use of the module. It is an error that check_plain() spits out when it is asked to display nothing, and it dutifully returns nothing to display. Now -why it is being asked to display nothing is a great question, and a stack trace will help.

Dropping priority to minor.

#7

NancyDru - February 29, 2008 - 12:48
Priority:minor» normal

Tell me how to do a stack trace and I will be happy to do one. Considering that an end user will see this and flood the admin with messages, this is not "minor."

#8

Joshua Brunner - February 29, 2008 - 19:21
Status:postponed (maintainer needs more info)» needs review

Patched wishlist.module and wishlist.page.inc. It works for me.

AttachmentSize
wishlist.module.patch 637 bytes
wishlist.page_.inc_.patch 946 bytes

#9

zilla - February 29, 2008 - 20:07

thanks - anybody try it out yet (scott)? if so, could it be commited to a new dev version, i have NO idea how to apply patches, only the whole files ;)

#10

NancyDru - February 29, 2008 - 20:17

@joshua: Can you explain what was wrong? This is happening on a lot more than just the Wishlist module.

#11

jrock - March 1, 2008 - 04:03

I just applied the patches and can confirm that it fixed this issue in Drupal 6.1. At least it did for me ;)

Thanks!

#12

scott.mclewin - March 1, 2008 - 06:35
Status:needs review» fixed

@joshua.brunner - thanks for pinpointing where the problem was. I took a slightly different approach to the repair as I think that the patch you submitted would still cause this same problematic behavior when an admin didn't configure their wishlist module to open in new windows. Not that your patch caused that problem - I did. But it left open another case where the problem could happen.

Give version 2.2 of the wishlist module a whirl. I didn't see any error in my dev environment when running it (but I'll admit being lazy in that I didn't first look for errors before making the change :) ). The code joshua.brunner pointed out was clearly wrong.

#13

Anonymous (not verified) - March 15, 2008 - 06:41
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#14

tgeller - August 26, 2008 - 00:30

This appears to have been fixed with a patch: See http://forum.civicrm.org/index.php?topic=4457.0 .

Cheers,

--Tom

 
 

Drupal is a registered trademark of Dries Buytaert.