Remove hook_form_alter from Domain Conf

agentrickard - March 17, 2009 - 18:43
Project:Domain Access
Version:6.x-2.0-rc6
Component:- Domain Conf
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

The reliance on system_site_information_settings form messes up i18n integration (among other things). So let's kill it.

#1

agentrickard - March 18, 2009 - 13:59

It is very likely that we can leverage hook_domainbatch() to provide the definitions of each setting. Then we would dynamically build the form based on the elements defined by that hook.

#2

agentrickard - March 25, 2009 - 20:02
Status:active» fixed

And the attached patch (committed) does just that!

AttachmentSize
405148-conf.patch 18.72 KB

#3

nonsie - March 25, 2009 - 22:49

There's one UI issue this new patch creates. Primary domain options appear twice in the selection - once as "Use primary domain settings" and the second time as the value of primary domain setting e.g. if there's three languages enabled on the primary domain (EN, ES, RU and EN is marked as default) then in the language selection there's 4 options (primary domain setting, EN, ES, RU). There is no way to tell in subdomain settings if EN was selected because it uses primary domain setting or it was set to EN.

Just my 2 cents.

#4

agentrickard - March 26, 2009 - 14:08
Status:fixed» needs review

Suggested fix? I am open to ideas here. What we need, though, is a means to say 'do not set a value for this variable for this domain'.

#5

nonsie - March 26, 2009 - 17:49

I think all we really need to do here is to eliminate duplicates in the UI eg. hide the default language if the variable is set to "primary domain" which also translates into "do not set a value for this variable for this domain".

This method should apply to all select elements not just language.

Attached patch is one way around it.

AttachmentSize
domain_conf.admin_.inc_.patch 864 bytes

#6

agentrickard - March 26, 2009 - 18:02

I wonder if we should apply this, in fact, to all form elements here.

#7

nonsie - March 26, 2009 - 18:26

Perhaps a better approach is (thinking from UI perspective):
- show two radio options. let's call them "Use primary domain settings" and "Apply custom settings"
- if "apply custom settings" is selected show all available values for selects (w/o "Use primary domain settings") and textfield/textarea/radios etc for the rest as it stands at the moment
- if "use primary domain settings" is chosen hide selects/textfields/textareas/radios for custom settings.

Some jQuery magic can take care of hiding form elements depending on radio option value.
Doing it this way would require creating an additional form element with #type = radios though...

Any other ideas?

#8

agentrickard - April 8, 2009 - 18:25

I don't know about the patch in #5, since that would make the Domain Conf form out of sync with the batch update form. Perhaps we just leave it alone?

On the topic of this overall issue, I just committed the attached.

AttachmentSize
405148-domain-conf-2.patch 1.13 KB

#9

nonsie - May 20, 2009 - 23:40

I think we can leave this as is in HEAD atm unless there are any comments?

#10

agentrickard - May 21, 2009 - 18:09

The problem left is with Domain batch operations, which inherit the default variable values from the domain the form(s) are entered on, which is undesireable and (at least) needs to be noted in the UI and the docs.

#11

agentrickard - June 7, 2009 - 17:44
Status:needs review» fixed

I simply added a warning. Patch attached.

AttachmentSize
405148-follow.patch 2.79 KB

#12

System Message - June 21, 2009 - 17:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.