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.
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
Comment #1
markwk CreditAttribution: markwk commentedYeah, 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...
Comment #2
btopro CreditAttribution: btopro commentedD6 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
Comment #3
markwk CreditAttribution: markwk commentedWhen 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.
Comment #4
hellomobe CreditAttribution: hellomobe commentedI 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!)
Comment #5
Robin Millette CreditAttribution: Robin Millette commentedThis is kind of fixed now, correct? At least 4 levels deep ;-)
Comment #6
btopro CreditAttribution: btopro commentedI'd accept a more elegant solution to this but yes at least to 4 levels of depth it should be working.