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

solotandem’s picture

Assigned: Unassigned » solotandem
Status: Active » Needs review
StatusFileSize
new3.21 KB

Attached patch implements proposed resolution.

solotandem’s picture

StatusFileSize
new3.07 KB

The attached patch is for the 7.x-3.x branch.

agentrickard’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Status: Needs review » Needs work

The 7.x.3 version is malformed, since hook_domainconf() was renamed to hook_domain_conf().

agentrickard’s picture

Issue summary: View changes

Add 7.x note.

jondos’s picture

Issue summary: View changes
StatusFileSize
new1.41 KB

Hello, 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.

jondos’s picture

Priority: Normal » Major
Status: Needs work » Needs review
agentrickard’s picture

Is there a good use-case to test this with? A specific variable setting that needs this recursion?

Does uc_domain still apply?

jondos’s picture

StatusFileSize
new38.91 KB
new5.68 KB

Hello, 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).

agentrickard’s picture

Great, thanks. This code helps a ton.

uc_domain is the module mentioned in the original post.

  • agentrickard committed db06bbb on 7.x-3.x authored by jondos
    Issue #1355082 by solotandem, jondos, agentrickard: Recurse the form...
agentrickard’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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