From 5e9b1f4d0e95067c52c078df3223f451cb1adc71 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 28 Aug 2013 21:23:31 +1200 Subject: [PATCH] CRM-13284 fix autofill for event page for anon users --- CRM/Event/Form/Registration/Register.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index add14e40aa..719fa2d981 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -142,13 +142,15 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { } $this->_defaults = array(); $contactID = $this->getContactID(); - if ($contactID) { - //@todo CRM-11915 I observed that even when the billing block is not present the routine to retrieve the billing defaults is still called - which seems a bit redundant. - $billingDefaults = $this->getProfileDefaults('Billing', $contactID); - $this->_defaults = array_merge($this->_defaults, $billingDefaults); - } + $billingDefaults = $this->getProfileDefaults('Billing', $contactID); + $this->_defaults = array_merge($this->_defaults, $billingDefaults); + $config = CRM_Core_Config::singleton(); // set default country from config if no country set + // note the effect of this is to set the billing country to default to the site default + // country if the person has an address but no country (for anonymous country is set above) + // this could have implications if the billing profile is filled but hidden. + // this behaviour has been in place for a while but the use of js to hide things has increased if (!CRM_Utils_Array::value("billing_country_id-{$this->_bltID}", $this->_defaults)) { $this->_defaults["billing_country_id-{$this->_bltID}"] = $config->defaultContactCountry; } -- 2.25.1