Object of class stdClass could not be converted to string in /home/xxx/html/sites/all/modules/campaignmonitor/campaignmonitor.module on line 455.

Has anyone seen this?

Comments

venusrising’s picture

Title: All of a sudden we are getting errors in our logs of Object of class stdClass could not be converted to string... » Object of class stdClass could not be converted to string...

All of a sudden we are getting errors in our logs of Object of class stdClass could not be converted to string...
When we disable the module it goes away.

The referer is showing http://www.oursite.com/admin/build/block

Does anyone know what may be causing this?

venusrising’s picture

Priority: Normal » Critical

Please let me know what may be causing this we are hunting and do not see why it is in the logs.

venusrising’s picture

Category: support » bug

Is this module being developed anymore?

ssherriff’s picture

Yes, sorry, I just really haven't had time to do anything with the module lately. I have asked for anyone to help maintain, but no one seems to be interested.

I think I have seen this before, but I'll have a look, and also I'll have a browse through the other bug reports, as it sounds familiar.

ssherriff’s picture

Hmm, it is happening when going through and collecting possible field key values.

In the admin, what do you have selected for the name field?

Do you have any special user modules or profile modules enabled?

It might help to try disabling all non-standard modules and seeing if you still get the error. Then enable each one until you find the error appears. If I know what other module might be conflicting, then I can try to come up with a fix so that they don't conflict.

venusrising’s picture

No the module still brings back the error, This is ONLY when I have the block enabled on a page for people to sign up (the one with the archive link.) Don't know if having that link showing when their are no archives could be the issue as the module shows on registration age fine. We use content profile and a couple other modules but nothing special or weird. the block even will show auto-filled with correct info of logged in user and I checked all APIS via CC and nothing has changed and they are all good.

ssherriff’s picture

I might try installing content profile to see if that causes it.

The error is definitely occuring here:

function campaignmonitor_campaignmonitor_field_key_values($user) {
  $out = array();
  $out = (array)$user;
  foreach ((array)$user as $key => $value) {
    if (is_array($value) && $key != 'role') {
      $out[$key] = implode('/', $value);                   // LINE 455
    }
    elseif (in_array($key, array('login', 'access', 'created'))) {
      $out[$key] = date('c', $value);
    }
    elseif ($key != 'roles') {
      $out[$key] = $value;
    }
  }
  $out = array_merge($out, _campaignmonitor_get_user_tokens($user));
  return $out;
}

Basically what the above function does is go through and get all possible tokens for the name field. Maybe there is some sort of field type in content profile that is causing this line to not like the value.

Is this causing any error in the actual functioning of the module? Like is it causing a subscribe or unsubscribe to fail?

venusrising’s picture

No, we have not seen any issues subscribing that I noticed just that ugly log errors =) Is there any way also that having the archive link when no archive exists does anything. I am not a programmer but happy to provide any info I can.

Thanks for replying to me.

ssherriff’s picture

Sorry, it has been a long time since I have had a look at this.

Is this still an issue? Just want to make sure before going further into the issue again.

krisrobinson’s picture

I just got this error also. Not sure why.

Subscribing.

krisrobinson’s picture

From what I can tell, the error comes about when the user's user name contains a space. So I have a user: "Test" or "TestUser" and it works fine.. but for a user called "Test User" with the space, I get this error... would that make sense?

ssherriff’s picture

I still can't cause this. I've tried a user with a space, and I still don't get the error.

Is anyone with some drupal experience getting this? It would be great if you could put some sort of watchdog statement above the line I've marked as 455 that prints out the key and value. That might give me an idea of what is causing it. Seeing what didn't cause that issue and what did.

ryank76’s picture

I'm still getting this. I'm not collecting Name at all, only email.

xtfer’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)