From 7f0f619d5ce2c2d723c2a9fd69fe70b0015aac3b Mon Sep 17 00:00:00 2001 From: colemanw Date: Sun, 12 Nov 2023 20:17:18 -0500 Subject: [PATCH] dev/core#4702 - Fix country/state chainSelect validation when country is deselected --- CRM/Core/Form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 4cfc3f115e..7b6847d182 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -2866,10 +2866,10 @@ class CRM_Core_Form extends HTML_QuickForm_Page { private function validateChainSelectFields() { foreach ($this->_chainSelectFields as $control => $target) { if ($this->elementExists($control) && $this->elementExists($target)) { - $controlValue = (array) $this->getElementValue($control); + $controlValue = (array) $this->getSubmitValue($control); $targetField = $this->getElement($target); $controlType = $targetField->getAttribute('data-callback') == 'civicrm/ajax/jqCounty' ? 'stateProvince' : 'country'; - $targetValue = array_filter((array) $targetField->getValue()); + $targetValue = array_filter((array) $this->getSubmitValue($target)); if ($targetValue || $this->getElementError($target)) { $options = CRM_Core_BAO_Location::getChainSelectValues($controlValue, $controlType, TRUE); if ($targetValue) { -- 2.25.1