Closed (fixed)
Project:
Localization client
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2008 at 06:31 UTC
Updated:
28 Feb 2008 at 12:02 UTC
After updating to D6rc4, while searching some keywords through the search engine, I got this error (and without my search result) :
warning: preg_match() expects parameter 2 to be string, array given in /home/mydomain/includes/bootstrap.inc on line 709.
pictogram
Comments
Comment #1
pictogram commentedWell in fact, the results are there, but still with the warning message.
Comment #2
gábor hojtsyAre you sure that this module causes the warning? This comes from the code inside drupal_validate_utf8(). Which might be used by some filter on your site, but is not used by l10n_client itself. It might use drupal_validate_utf8() indirectly though. The "search engine" you mention is the search box with the X by its side at the bottom part of the page?
Comment #3
gábor hojtsyComment #4
pictogram commentedNo, no, let me clarify my post.
I'm not talking about the search box within the localization client. I'm talking about the drupal search engine. The search box returns this error when l10n_client is installed. I tried uninstalling every module and it stopped when I deactived the client. Reinstalling it returned again the same error ?!?!?
I know that bootstrap.inc is a core file but since activating the client returns an error inside it, I thought it would most probably come from the client ?? But maybe I'm wrong ???
Comment #5
gábor hojtsyHm, interesting. It would be great if someone else could reproduce this.
Comment #6
macedigital commentedHere is a way to reproduce:
Do a fresh drupal 6.0 install, enable the l10n_client module (and its dependencies). Enable "search box" in garland theme settings, so the search box is omnipresent in the left sidebar and type random search strings.
Result: Every result page will display this error.
I can confirm, that if l10n_client module is not enabled, there is not the message warning: preg_match() expects parameter 2 to be string, array given in /path/to/drupal6/includes/bootstrap.inc on line 721.
Function drupal_validate_utf8() triggers the warning, which expects to preg_match a string, but is given an array. If one explicitly typecasts the passed $text var, the function will work. The array passed to the function which causes the warning comes from the function l10n_client_search(), from l10n_client.module, line 210.
Then I got interested as to why this specific form api array is passed through the drupal_validate_utf8() function. My take is it, that former function actually implements the hook_search() function. I don't know if this is intended here ?
After I renamed the above function to l10n_client_search_form() the warning message went away.
Comment #7
gábor hojtsyYes, it sounds reasonable that it indeed implements the search hook.
Comment #8
gábor hojtsyI committed this change to fix the issue: http://cvs.drupal.org/viewcvs/drupal/contributions/modules/l10n_client/l... Thanks for the analysis, much appreciated. Now onto releasing the fixes.
Comment #9
macedigital commentedYou're welcome :)
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.