I have the uc_domain module installed and was perplexed why the uc domain form settings were never getting displayed on the domain_conf_form. I tracked it down to this little one liner.

To see the bug, install uc_domain and try to save some domain-specific settings in the uc section of the form. The values actually do get saved, but then when you redisplay the for, none of the #default_value's on the elements are set.

Index: domain_conf.module
===================================================================
--- domain_conf.module	(revision 2934)
+++ domain_conf.module	(working copy)
@@ -531,7 +531,7 @@
   if (!empty($extra)) {
     foreach ($extra as $key => $value) {
       foreach (element_children($value) as $element) {
-        if (isset($value[$element]['#default_value']) && isset($settings[$element])) {
+        if (!($value[$element]['#default_value']) && isset($settings[$element])) {
           $value[$element]['#default_value'] = $settings[$element];
         }
       }

Comments

agentrickard’s picture

Title: uc_domain settings not getting displayed » uc_domain settings must pass #default_value
Project: Domain » Ubercart Domain Access
Version: 6.x-2.0 » 6.x-1.x-dev
Component: - Domain Conf » Code

What is the default value that uc_domain is trying to pass?

This looks like a bug in uc_domain for not passing in a #default_value. The change you suggest would only fire if there was no default_value passed in, which is wrong.

Moving to a uc_donate bug.