Problem/Motivation
If a module defines a configuration form with nested fieldsets, then the saved settings for the domain are not re-populated.
To recreate this, enable a module that implements hook_domainconf() and uses nested fieldsets (e.g. the uc_domain module), display the settings form for a (non-primary) domain, enter values, and click save. On page reload, the default settings displayed will be those for the primary domain.
Proposed resolution
Modify domain_conf_api() to recurse the form elements.
Remaining tasks
Review, write tests.
User interface changes
None.
API changes
None.
This change also applies to the 7.x branch (with a very similar patch).
Comments
Comment #1
solotandem commentedAttached patch implements proposed resolution.
Comment #2
solotandem commentedThe attached patch is for the 7.x-3.x branch.
Comment #3
agentrickardThe 7.x.3 version is malformed, since hook_domainconf() was renamed to hook_domain_conf().
Comment #3.0
agentrickardAdd 7.x note.
Comment #4
jondos commentedHello, I slightly modified the patch and fixed the errors I have found.
My patch is for the current 7.x branch.
I did not add new tests, but the existing tests ran as good (or bad) as without this patch, at least.
This is a really bug. So I think it to be important to get it fixed.
Comment #5
jondos commentedComment #6
agentrickardIs there a good use-case to test this with? A specific variable setting that needs this recursion?
Does uc_domain still apply?
Comment #7
jondos commentedHello, thank you for your quick response!
What do you mean with "uc_domain"?
Our use case is the following:
* The goal is a nice formatting of form elements that belong together. In our case, settings that are tightly connected to each other, see attached file "domain-admin-Form-demo.png".
* You will find the corresponding code in "domain-admin-form-demo.txt".
It seems there is no other way to achieve this row formatting than to use nested fieldsets or containers (note that with containers, the same problem occurs). Without, Drupal will display every form field in a single row, which is not user friendly (and not what the customer wants).
Comment #8
agentrickardGreat, thanks. This code helps a ton.
uc_domain is the module mentioned in the original post.
Comment #10
agentrickardCommitted.