I got errors while reverting a feature that included domain_theme configurations.
Php warned me about an invalid index defined at line 102 of the domain_theme.features.inc so i've tried to debug that.
It was about domain_theme_features_rebuild($module), that function loops inside the $defaults array created using domain_features_load() function that i didn't investigate, inside that loop it stores the array values as $themes and then loops inside each $themes storing values as $theme.
Then it creates a $record array that will be passed through drupal_write_record() after populating it with the same keys and values of $theme.
Anyway, in my situation, $themes was holding a nested array with its same key so i fixed looping inside $themes[$key] instead of $themes, that way i could really access the keys and values to be saved as the $record ones too.
So, basically, line 96 becomes foreach ($themes[$key] as $theme) { instead of foreach ($themes as $theme) { .
Take a look at this, please...
Thanks,
Da.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1379182-domain-theme-features.patch | 602 bytes | agentrickard |
Comments
Comment #1
agentrickardThis is impossible to read and debug.
Please state the problem more clearly, and, if possible, attach the feature output.
Comment #2
planctus commentedThis is the function i was speaking about, this way it is working. I've made changes here:
foreach ($themes[$key] as $theme) {it was
foreach ($themes as $theme) {My feature's output about domain_theme is:
Comment #3
agentrickardThanks. That is not the export structure that I would expect.
Are you using subthemes?
Comment #4
agentrickardConfirmed.
Comment #5
agentrickardI think the attached is the better patch. The problem is that we are nesting the array when we don't have to.
Better to fix that problem, though it will require people to update their Features. But I think we caught this soon enough.
In theory, we might check for that array nesting too, but I would prefer not to do so.
Comment #6
planctus commentedI've tried the patch and it works after deleting and re-creating the feature from scratch.
thanks,
Da.
Comment #7
agentrickardDo you think it's fair to users to push that patch out, effectively saying "We goofed. Please rebuild your feature."
Comment #8
agentrickardCommitting, with a note about updating features.