preg_match() expects parameter 2
Adrian - March 4, 2009 - 22:13
| Project: | Quickstats |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi everyone !
I have a little problem with this module.
I'm using OG Group, and flashvideos(videos for the group for sure... :D).
When I activate de QuickStats module, i have this error
warning: preg_match() expects parameter 2 to be string, array given in /var/www/html/includes/bootstrap.inc on line 771Any advice to solve the problem?
See ya ;)

#1
Do you get this when you visit specific pages? Related to OG maybe?
#2
I do not have any OG modules and got the error using Quickstats.
I had Quickstats activated for a few weeks and did not see the error. Then I tried to run the patch to make Quickstats available to Views, templates, etc.
Running the included patch does not work on 6.10 node.module, so I tried to hack node.module myself to get a node_load to return the quickstats_views field.
I had to undo the node.module hack and disable, then uninstall quickstats entirely to get the error to go away.
I've seen a lot of issue queues report this error regarding various contrib modules. It's not just Quickstats that runs afoul of this bootstrap error.
This is the line in bootstrap by the way:
<?phpfunction drupal_validate_utf8($text) {
if (strlen($text) == 0) {
return TRUE;
}
return (preg_match('/^./us', $text) == 1); // THIS is line 771
}
?>
Again, simply un-doing the changes I made to node.module seemed to have no effect. The error continued until I removed Quickstats entirely.
#3
I have the same error.
when I start the statistics module and enabled the popular block!
#4
Still haven't figured out how Quickstats triggers it.
On the good side, I figured out how the Quickstats module could be changed to not require the node.module patch. Node.module used to retrieve specific data fields for a node_load by listing them in a SQL call - which is the call the patch alters, by adding quickstats_views to the list of fields being loaded.
The more recent node.module just calls all fields in node table (SELECT *) for a node_load, using the node table schema. To get the quickstats_views field in there, the quickstats.install file needs a schema hook to add the field into the default node schema, which in turn is used for the node_load function.
However, even finding an alternative to patching the node.module directly, the preg_match error still shows up.
It's not like there aren't other integer fields in the node table, so I don't know why preg_match has a problem. I'll try to trap specifically what it doesn't like. Might be a few days before I get to it.
#5
Thanks ccshannon - I don't have a clue of what could be causing this either, its not like the module is doing complicated things with the node table.
#6
I also get the same error can someone please help?
#7
It is triggered because the core Statistics module is in conflict with Quickstats and duplicate entries are created.
You've got 2 options until this is fixed :
1) Don't use the core Statistics module (and any modules that are based on that). You should disable the module AND uninstall it to delete the stats that it created
2) Don't use the quickstats module and use the core Statistics instead