X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FForm.php;h=613bcf227deeb3854f3d1edf4f214b2eec23a4fe;hb=8f86a6bebee8ba95e9c1e5fa5009b09ca51e03b6;hp=113411d7ff83c9ddb81115c849b3147f2a9d748f;hpb=0c5302177abdd62e8001e00a493d19dcdabdd2d5;p=civicrm-core.git diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 113411d7ff..613bcf227d 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -179,6 +179,29 @@ class CRM_Core_Form extends HTML_QuickForm_Page { */ public $urlPath = array(); + /** + * Context of the form being loaded. + * + * 'event' or null + * + * @var string + */ + protected $context; + + /** + * @return string + */ + public function getContext() { + return $this->context; + } + + /** + * Set context variable. + */ + public function setContext() { + $this->context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this); + } + /** * @var CRM_Core_Controller */ @@ -1566,6 +1589,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { return $this->addEntityRef($name, $label, $props, $required); case 'Password': + $props['size'] = isset($props['size']) ? $props['size'] : 60; return $this->add('password', $name, $label, $props, $required); // Check datatypes of fields @@ -1845,7 +1869,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $setDefaultCurrency = TRUE ) { $currencies = CRM_Core_OptionGroup::values('currencies_enabled'); - if (!array_key_exists($defaultCurrency, $currencies)) { + if (!empty($defaultCurrency) && !array_key_exists($defaultCurrency, $currencies)) { Civi::log()->warning('addCurrency: Currency ' . $defaultCurrency . ' is disabled but still in use!'); $currencies[$defaultCurrency] = $defaultCurrency; } @@ -2045,7 +2069,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $validUser = CRM_Contact_BAO_Contact_Utils::validChecksum($tempID, $userChecksum); if ($validUser) { CRM_Core_Resources::singleton()->addVars('coreForm', array('contact_id' => (int) $tempID)); - CRM_Core_Resources::singleton()->addVars('coreForm', array('checksum' => (int) $tempID)); + CRM_Core_Resources::singleton()->addVars('coreForm', array('checksum' => $userChecksum)); return $tempID; } }