I need to define with Strongarm a variable that is multidimentional, e.g.:
function mymodule_strongarm() {
$variables = array(
'my_var' => array(
0 => array(
'my_key1' => "foo",
'my_key2' => "bar",
),
),
);
...
When I open Strongarm page (admin/config/development/strongarm), I get this error: Notice: Array to string conversion in _strongarm_readable() (line 116 of <snap>/sites/all/modules/strongarm/strongarm.admin.inc).
It seems that Strongarm presumes that all variables of type Array are only one dimentional arrays, therefore implode()
function that is called within _strongarm_readable()
throws this error if variable of type Array has elements that are arrays.
The patch that is attached solves this bug by checking whether variable of type Array has elements of type Array, and allows implode() function to be called only if no elements of type Array are found within the variable.
Comment | File | Size | Author |
---|---|---|---|
#2 | strongarm-array-to-string-conversion-1946858-2.patch | 726 bytes | BillyTom |
strongarm.admin_.inc_.diff | 726 bytes | maijs |
Comments
Comment #1
daften CreditAttribution: daften commentedI'm experiencing the same problem
Comment #2
BillyTom CreditAttribution: BillyTom commentedI have the same issue in the current version. The patch that maijs provided fixed the problem for me.
I have renamed the patch according to the patch guideline
Comment #3
joelpittetForgot to put this up for review.
Comment #4
joelpittetNot sure if this is the right approach but it fixes all those notices so thank you.
Comment needs to wrap at 80 chars. Can be fixed on commit.