Hi,

Running Drupal 6.25, when ever I edit a page I get the following Warning:

warning: trim() expects parameter 1 to be string, array given in .../sites
/all/modules/seo_friend/seo_friend.module on line 492.

The Page still saves successfully.

Comments

kristen pol’s picture

Status: Active » Fixed

I just committed a change to check if the value was empty before trimming. It will be in the next dev release when that is packaged by drupal.org... check the timestamp.

Thanks,
Kristen

Status: Fixed » Closed (fixed)

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

simone.girlanda’s picture

Version: 6.x-1.1 » 6.x-1.x-dev

still having error even if dev version installed

warning: trim() expects parameter 1 to be string, array given in /var/www-drupal-6.26/sites/all/modules/seo_friend/seo_friend.module on line 494.

    if ($module == 'nodewords') {
        $tag_value = $form_state['values']['nodewords'][$tag]['value'];
         if (! empty($tag_value)) {
           $tag_value = trim($tag_value);    <strong> <-- line 494</strong>
        }
        $fieldset = 'nodewords';
      }
      else {
        $tag_value = trim($form_state['values'][$tag]);
        $fieldset = null;
      }
simone.girlanda’s picture

Status: Closed (fixed) » Active

Problem still presente.
changed status from closed to active (is this correct ?)

kristen pol’s picture

If you know how to edit the file (which it looks like you do based on our comment), try putting in:

echo "The variable value is: " . $tag_value;
echo "The variable type is: " . gettype($tag_value);

Before the line in question. If it's not a string and not null, I have no idea *what* it is :)

miccelito’s picture

Any solution yet? I get the same error messages.

I suppose the line 493:

if (! empty($tag_value)) {

should be changed, but I have poor php knowledges..

if (! empty($tag_value) && is_string($tag_value)) {

would be totally wrong?

kristen pol’s picture

I have updated 6.x-1.x-dev so you can try that and see if it fixes. I have noticed that nodewords has changed a lot again... sigh... so I'm not getting nodewords duplicates showing up with the latest nodewords...

kristen pol’s picture

Status: Active » Fixed
kristen pol’s picture

Assigned: Unassigned » kristen pol
miccelito’s picture

I did try again after your fix. Those error messages are gone :)

Status: Fixed » Closed (fixed)

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

kristen pol’s picture

Assigned: kristen pol » Unassigned
Issue summary: View changes

cleaning up my issues list