Deprecate CRM_Core_Config::addressSequence()
authorMatthew Wire (MJW Consulting) <mjw@mjwconsult.co.uk>
Fri, 23 Aug 2019 22:44:13 +0000 (23:44 +0100)
committerMatthew Wire (MJW Consulting) <mjw@mjwconsult.co.uk>
Fri, 23 Aug 2019 22:44:13 +0000 (23:44 +0100)
CRM/Contact/BAO/Contact/Utils.php
CRM/Core/BAO/Address.php
CRM/Core/Config.php
CRM/Core/Page/AJAX/Location.php

index 41659ba38acc3ca3c917c4edf1820e0f501b8ac3..28f380249093a9fd91665141bfd39241fbda55bb 100644 (file)
@@ -442,9 +442,6 @@ WHERE id={$contactId}; ";
    *
    */
   public static function buildOnBehalfForm(&$form, $contactType, $countryID, $stateID, $title) {
-
-    $config = CRM_Core_Config::singleton();
-
     $form->assign('contact_type', $contactType);
     $form->assign('fieldSetTitle', $title);
     $form->assign('contactEditMode', TRUE);
@@ -482,7 +479,7 @@ WHERE id={$contactId}; ";
         );
     }
 
-    $addressSequence = $config->addressSequence();
+    $addressSequence = CRM_Utils_Address::sequence(\Civi::settings()->get('address_format'));
     $form->assign('addressSequence', array_fill_keys($addressSequence, 1));
 
     //Primary Phone
index 71ebf132db34c44a174ddefc3c13721604488b0c..63d3682a07dbb11793b313decbd447b55119e53d 100644 (file)
@@ -663,8 +663,7 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC,
    *   Array of address sequence.
    */
   public static function addressSequence() {
-    $config = CRM_Core_Config::singleton();
-    $addressSequence = $config->addressSequence();
+    $addressSequence = CRM_Utils_Address::sequence(\Civi::settings()->get('address_format'));
 
     $countryState = $cityPostal = FALSE;
     foreach ($addressSequence as $key => $field) {
index 4e3679fb6d4d305d38afedff0d4e7261fda28ada..fd16d466b8b23c96c526744999fa8160232d91f5 100644 (file)
@@ -471,6 +471,7 @@ class CRM_Core_Config extends CRM_Core_Config_MagicMerge {
    * @deprecated
    */
   public function addressSequence() {
+    CRM_Core_Error::deprecatedFunctionWarning('CRM_Utils_Address::sequence(Civi::settings()->get(\'address_format\')');
     return CRM_Utils_Address::sequence(Civi::settings()->get('address_format'));
   }
 
index 7a998fe2a523caa951764e81bd2b2c3808b8e6e3..f54c05d2c47345d4342ed2cd4548be0dc88ee60a 100644 (file)
@@ -67,8 +67,7 @@ class CRM_Core_Page_AJAX_Location {
     $entityBlock = ['contact_id' => $cid];
     $location = CRM_Core_BAO_Location::getValues($entityBlock);
 
-    $config = CRM_Core_Config::singleton();
-    $addressSequence = array_flip($config->addressSequence());
+    $addressSequence = array_flip(CRM_Utils_Address::sequence(\Civi::settings()->get('address_format')));
 
     $profileFields = CRM_Core_BAO_UFGroup::getFields($ufId, FALSE, CRM_Core_Action::VIEW, NULL, NULL, FALSE,
       NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL