I've run into an issue where if I view the dashboard at admin/commerce/reports, any links I click from that page generate the following string of errors repeatedly.
Warning: Invalid argument supplied for foreach() in element_children() (line 6300 of /Users/dave/Sites/holidayleds/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5767 of /Users/dave/Sites/holidayleds/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5777 of /Users/dave/Sites/holidayleds/includes/common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5815 of /Users/dave/Sites/holidayleds/includes/common.inc).
Warning: Illegal string offset '#printed' in drupal_render() (line 5822 of /Users/dave/Sites/holidayleds/includes/common.inc).
In my testing it appears that this happens if the server is running PHP 5.4. If it is on 5.3 everything is fine. I was able to reproduce this by installing Kickstart2 with no content then enabling the Reports module. At that point just go to the reports dashboard and click anything, such as the Products tab or even any links in the admin bar.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | commerce_reports-views_block_render_bug_fix-1827312-4.patch | 722 bytes | michfuer |
Comments
Comment #1
stefank commentedHi
I've got the same problem here, running PHP version 5.4.
Any news on that?
Thanks
Comment #2
Henrik E Bechmann commentedDitto
Comment #3
mglamanI have the same issue - its because a variable is coming up null when rendering the template ( https://drupal.org/node/1711256#comment-6334838 ). I'm exploring what it could be, but it's like a needle in a haystack if anyone else has input.
Comment #4
michfuer commentedThe errors only appear when trying to render Views blocks. It seems drupal_render() doesn't like trying to render the return of views_block_view(). Instead for Views blocks we should only render the 'content' portion of the return.
This patch resolves the issue for me.
Comment #5
dpearcefl commentedCan someone experiencing the problem please test this patch?
Comment #6
mattcoady commentedPatch made the error go away for me.
Comment #7
stefank commentedSorry the error was not displaying in my case anymore before you submit the patch @michfuer. No need to test for me.
Thanks anyway
Comment #8
mglamanPatch from #4 worked to fix render notices
Comment #9
mglamanCommitted to 7.x-3.x, thanks michfuer.
Comment #10
mglaman