This appears when creating a content that has the following CCK field types:
- Date
- Text
- Link
- Node reference

1) The error appears only for the non-default languages (I have 3, En works correctly, Fr and El fail)
All my other content types (16) behave correctly. Many use these fields too.

2) The error is not fatal, the content is correclty created.
3) The error shows up every time the content is edited, for new content as for old ones

I post this here, because there are a bunch of recent reports of the same error in other contexts:
http://drupal.org/node/391352
http://drupal.org/node/379236
http://drupal.org/node/395836
http://drupal.org/node/384030
http://drupal.org/node/388058

Comments

jvieille’s picture

Status: Active » Closed (fixed)

Problem found:
one node reference field was using as selector a view which it did not like.
Changing the view sovled the problem.

Hope this will help others to diagnoze their similar issues

swortis’s picture

Can you describe how you changed the view to stop the error? Is there a consistency to what is in the view which leads to the error?

Thanks!

jvieille’s picture

I just created a new similar (identical!) view and changed its reference where it was refered to (a Node reference field using a Views to select the nodes).

Marko B’s picture

I have same problem when using filters in view for CCK type fields, when i remove this fields its ok. Seems this problem apperas on many modules and combinations of setup.

bobzibub’s picture

Don't hack core at home, but to track down the error, I tweeked the code from:

function drupal_validate_utf8($text) {
  if (strlen($text) == 0) {
    return TRUE;
  }
  return (preg_match('/^./us', $text) == 1); //// where error occurs
}

to:

function drupal_validate_utf8($text) {
  if (strlen($text) == 0) {
    return TRUE;
  }  if (!is_string($text)) dprint_r($text); ////// added one liner to keep line numbers..
  return (preg_match('/^./us', $text) == 1);
}

I found that $text was actually an array, and it was (in my case) an array being passed for a form "radios" default value, when it should have been some text string.

Hope it helps!
-b

Marko B’s picture

@5 i dont understand, what did u do? code is the same execpt the print part. How could i make it stop showing errors for this with this code?

thanx

bobzibub’s picture

The Drupal code validates a string. What I'm attempting to find out is "What input to this function is causing the problem?" or in this case "what array?" I should have used var_dump instead of dprint_r.

What this did for me was show the parameter which threw the error. It would be better yet in a try/catch block.

-b

Marko B’s picture

Ok so this is not drupal core error, but module error.

-Btw for the top #0 i dont have any lang. installed, only En but still have this errors.