What's the best/correct way to alter the data when the value of a variable outputs as "Array".

variables[globalredirect_settings] = Array
variables[globalredirect_settings] = Array
variables[globalredirect_settings] = Array
variables[globalredirect_settings] = Array

from dev variable editor I get (one row in the database):
Array
(
[menu_check] => 1
[case_sensitive_urls] => 0
[canonical] => 1
[term_path_handler] => 0
)

This may not be directly a profile builder "issue", but thanks for the direction in advance.

Comments

markwk’s picture

Yeah, handling arrays have been one of a few issues that comes up with using profiler. You'll want to check with profiler library on this specific issue. I would assume it's done via something like: variables[globalredirect_settings][menu_check] = X

It's definitely possible to use arrays in a traditional installation profiles to with the above syntax...

btopro’s picture

D6 version outputs that correctly i dono about the 7 version. variables[globalredirect_settings][arraypositionname] = value will work even as deeply nested arrays. builder 6x works up to like 3 or 4 levels deep for generation in this manner. To define something as an empty array... that i'm not sure

markwk’s picture

When it was ported to D7, I never really investigated this issue about nested arrays. I guess didn't really notice this issue to be honest. Since then, I haven't really invested any time into this module at all.

hellomobe’s picture

I don't think it's a big issue after all -- I noticed that most of the variables that returned array are handled by Features/strongarm or defaults of their modules that I didn't need changing. Easy to fix though with the above examples and devel variable editor.

Thanks for the module -- life saver (at least a time saver!)

Robin Millette’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Status: Active » Fixed

This is kind of fixed now, correct? At least 4 levels deep ;-)

btopro’s picture

I'd accept a more elegant solution to this but yes at least to 4 levels of depth it should be working.

Status: Fixed » Closed (fixed)

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