Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As of now, I'm only using context to essentially replace the block module. I was getting this notice with beta3 as well, but hadn't reported it.
Notice: Array to string conversion in theme_context_block_script_placeholder() (line 66 of /.../context/theme/context_reaction_block.theme.inc).
Comment | File | Size | Author |
---|---|---|---|
#21 | array_to_string_fix-1727794-20.patch | 692 bytes | brunodbo |
#20 | array_to_string_fix-1727794-20.patch | 692 bytes | idflood |
#11 | context-1727794-array-to-string-fix.patch | 1.13 KB | skwashd |
#9 | context-array_to_string_error-1727794-9.patch | 798 bytes | kurtzhong |
#4 | Array-to-text-conversion-error.patch | 794 bytes | bleen |
Comments
Comment #1
thorsten. CreditAttribution: thorsten. commentedI get exactly the same error.
Comment #2
eagle82 CreditAttribution: eagle82 commentedI was receiving this error, I handled it by adding the following:
I've attached a patch for it.
Comment #3
bleen CreditAttribution: bleen commentedThis seems to be the correct fix and it works in my testing
Comment #4
bleen CreditAttribution: bleen commentederrrr .... but it is not correct in terms of coding standards.
This is more betterer
Comment #5
eagle82 CreditAttribution: eagle82 commentedThanks for the correction on the coding standards. This should be patched, it's an annoying little issue.
Comment #6
bleen CreditAttribution: bleen commentedI'm not going to un-mark this as RTBC, but I think I might have been sleep-coding at the time I reviewed/re-patched this...
The correct solution would be to ensure that only a string is ever passed into the theme function and not simply serilizing the array. In fact printing out the serialized array in the HTML output is just weird. It does serve as a good workaround for the time being though...
Comment #7
skwashd CreditAttribution: skwashd commentedI agree with @bleen18. This is just hiding a symptom of a deeper problem.
Comment #8
kurtzhong CreditAttribution: kurtzhong commentedIn my case this notice is caused by the admin module, do you all use this module as well?
Comment #9
kurtzhong CreditAttribution: kurtzhong commentedMaybe this is just a theming function issue.
Comment #10
jbrown CreditAttribution: jbrown commentedThis works!
Comment #11
skwashd CreditAttribution: skwashd commentedThe patch proposed by @kurtzhong doesn't account for the case where $text could still be a string - as per the original implementation and method signature suggesting. The attached version handles that. We have this running on a couple of projects already.
Comment #12
kurtzhong CreditAttribution: kurtzhong commentedI just think that the theme function should receive parameters as defined by hook_theme.
And we don't call
theme_context_block_script_placeholder
directly instead oftheme('context_block_script_placeholder', $vars)'
. Please correct me if i am wrong.Comment #13
dealancer CreditAttribution: dealancer commentedPatch #11 works well for me.
Comment #14
semei CreditAttribution: semei commentedCould we please get this into the dev?!
Comment #15
jbrown CreditAttribution: jbrown commentedWhen is the parameter a string? Shouldn't a theme function follow the standard parameters?
Comment #16
chrisroane CreditAttribution: chrisroane commented#11 worked for me as well. I am using the admin module with a custom theme.
Comment #17
mari3.14 CreditAttribution: mari3.14 commented#11 worked like a charm
Comment #18
Finn Lewis CreditAttribution: Finn Lewis commented#11 also works fine for me.
Still not committed to dev branch?
Is this where we mark it RTBC?
Comment #19
criscom#11 also worked for me. Using admin module with Omega subtheme.
Comment #20
idflood CreditAttribution: idflood commentedI've made the change like kurtzhong said in #12. The following patch should fix the root of the issue.
Comment #21
brunodboPatch in #20 works for me. Changed double quotations to single to follow the style Context uses, since there is no hard standard for this in Drupal.
Comment #22
thorsten. CreditAttribution: thorsten. commentedThanks 4 the patch!
Works great.
Comment #23
skwashd CreditAttribution: skwashd commentedWorks for me.
Comment #24
tekante CreditAttribution: tekante commentedFixed in commit 3ed08f32a11a39082879940588f6d020b23af852 using patch from #21 since theme functions should expect a variables array. Thanks for the bug report, patch and testing.
Comment #26
ivanhelguera CreditAttribution: ivanhelguera commentedStill getting the message with the beta 7. I'm using D7.23 on Apache 2.2/PHP 5.4 (Ubuntu 13.04).
IH
Comment #27
kilrizzy CreditAttribution: kilrizzy commentedGetting the same error
Comment #28
marameodesignsubscribe
Comment #29
D7Newbie CreditAttribution: D7Newbie commentedI'm getting 'Notice: Array to string conversion in theme_item_list() (line 2223 of /var/www/html/includes/theme.inc).'
The problem appears to be a div in the custom theme template.
It's outputting
div class "region region-content" data-thmr="thmr_249"
div id="block-system-main" class="block clock-system" data-thmr="thmr_248"
div class="block-content clearfix" - instead of div class="content"
It must be a template in the theme and not the inc file, because all the other themes work fine.
Any idea what template outputs that div - is it page?