After a clean successful upgrade following instructions here I am getting this Notice:
Notice: Array to string conversion in oa_core_get_cache_id() (line 69 of /var/www/html/profiles/openatrium/modules/contrib/oa_core/includes/oa_core.cache.inc).

Looking at line 69 from oa_core.cache.inc I don't understand why the error.

68     foreach ($args as $arg) {
69       $cid .= '_' . (!empty($arg) ? $arg : '');
70     }

Anyone have any idea's? I Flushed all cache and not sure what else I can do. Any suggestions would be appreciated.

CommentFileSizeAuthor
#8 oa_core_array_to_string-2437855-8.patch1.11 KBmpotter

Comments

wildweaselmi’s picture

Issue summary: View changes
mpotter’s picture

Not seeing that on any of our systems here. The oa_core_get_cache_id() function is passed an optional array of $arg to use to build the cache id (cid). Each element in the $arg array should be a string. I don't see anywhere in Open Atrium where non-strings are passed to it.

To debug this you'll need to add a test between line 68 and 69 for something like this:

  if (!is_string($arg)) {
    print_r($arg);
    print "---<pre>";
    print_r(debug_backtrace());
    print "</pre>"
  }

That will dump whatever the bad $arg value is and also give a traceback to see who is calling this function with the bad argument. You can post the output here if you want me to help review it.

ttaylor249’s picture

I'm seeing this as well, but only occasionally, and not easily reproducible. I added the debugging code from #2, but this causes huge debug traces to be dumped on almost every page load because the $args parameter to oa_core_get_cache_id() is passed empty elements and integer elements. I've changed the debugging code to this:

if (is_array($arg)) {
  print_r($arg);
  print "---<pre>";
  print_r (debug_backtrace());
  print "</pre>"
}

to better reflect what's actually causing the error message. If I see the error again, I'll post the stacktrace.

katrien_w’s picture

I have the same error since upgrade to 7.32 yesterday.
If I place the debug code in between 68 and 69 I get a "Parse error: syntax error, unexpected '}' in ...oa_core.cache.inc on line 77".

mpotter’s picture

Sorry, there should be a ; character after the last "print "

" line. So code should be this:

if (is_array($arg)) {
  print_r($arg);
  print "---<pre>";
  print_r (debug_backtrace());
  print "</pre>";
}
joevagyok’s picture

Version: 7.x-2.31 » 7.x-2.32

I'm having the same issue, I inserted the debugging code, but so huge data printed, it's not possible to copy, my browser also struggling with it, I will try to save it in a file for you.

I'm using 2.32

joevagyok’s picture

I was able to have smaller output by using an edit form:

http://pastebin.com/H38yDJjF

Thanks

mpotter’s picture

Category: Support request » Bug report
Status: Active » Needs review
StatusFileSize
new1.11 KB

@joevagyok Thanks very much for that stack trace, it really helped.

Here is a patch for oa_core to try for fixing this issue

joevagyok’s picture

Your welcome Mike!

I don't have git for now, so I did patching by hand. For me it seems good, I mean after drush cc all I had no error afterwards.

Good Job!

Thanks

mpotter’s picture

Status: Needs review » Fixed

Committed to oa_core dev e669bda

katrien_w’s picture

I had the error on a space, applied the patch and now I get
Notice: Undefined index: ctools_field_list in ctools_entity_field_content_type_formatter_styles_submit() (line 234 of /mnt/nfs/staging/k00012/htdocs/profiles/openatrium/modules/contrib/ctools/plugins/content_types/entity_context/entity_field.inc).
Is this related?

mpotter’s picture

Nope, that is something completely different and not something I have seen before. Are you sure you applied the upgrade to 2.32 correctly and removed your old files and replaced them with the new files? Sounds like you might have a problem with the entity module. But please post this to a new issue since it's not related to the issue fixed here.

jacrsteiner’s picture

Great, patched from #8 and haven't reproduced error since. Thanks.

theflathead’s picture

I got the same error on the Home page right after logged into Open Atrium 2.
I'm using Drupal 7.34.
The patch worked like a charm!
Thanks, Mike! You made my day :)

FO’s picture

Thanks for the patch !

jacobson’s picture

Had the same error, and the patch worked for me.

Status: Fixed » Closed (fixed)

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