From 319bd9a76be9756865efb64fefc8aa24958ad75e Mon Sep 17 00:00:00 2001 From: Bohdan Dmytryshyn Date: Wed, 26 Feb 2020 16:48:09 +0200 Subject: [PATCH] Release 5.0.1. --- .../ApiWrapper/EntityTag/Get.php | 5 ++- CRM/CiviMobileAPI/Form/Settings.php | 42 ++++--------------- civimobileapi.php | 6 ++- info.xml | 4 +- 4 files changed, 19 insertions(+), 38 deletions(-) diff --git a/CRM/CiviMobileAPI/ApiWrapper/EntityTag/Get.php b/CRM/CiviMobileAPI/ApiWrapper/EntityTag/Get.php index ecbb515..1525393 100644 --- a/CRM/CiviMobileAPI/ApiWrapper/EntityTag/Get.php +++ b/CRM/CiviMobileAPI/ApiWrapper/EntityTag/Get.php @@ -27,9 +27,12 @@ class CRM_CiviMobileAPI_ApiWrapper_EntityTag_Get implements API_Wrapper { */ public function toApiOutput($apiRequest, $result) { foreach ($result['values'] as &$value) { + if (empty($value['tag_id'])) { + continue; + } + try { $tagInfo = civicrm_api3('Tag', 'getsingle', [ - 'sequential' => 1, 'id' => $value['tag_id'], ]); } catch (CiviCRM_API3_Exception $e) { diff --git a/CRM/CiviMobileAPI/Form/Settings.php b/CRM/CiviMobileAPI/Form/Settings.php index 0e17a0d..5211b4a 100644 --- a/CRM/CiviMobileAPI/Form/Settings.php +++ b/CRM/CiviMobileAPI/Form/Settings.php @@ -1,27 +1,4 @@ exportValues(); if (!empty($params['_qf_Settings_submit'])) { - if (!empty($params['civimobile_auto_update'])) { - Civi::settings()->set('civimobile_auto_update', 1); - } - else { - Civi::settings()->set('civimobile_auto_update', 0); - } - if (empty($params['_qf_Settings_next'])) { Civi::settings()->set('civimobile_server_key', $params['civimobile_server_key']); - CRM_Core_Session::setStatus(ts('Server key updated')); + CRM_Core_Session::singleton()->setStatus(ts('Server key updated'), ts('CiviMobile Settings'), 'success'); } } elseif (!empty($params['_qf_Settings_next'])) { @@ -186,7 +156,7 @@ class CRM_CiviMobileAPI_Form_Settings extends CRM_Core_Form { $this->controller->setDestination(CRM_Utils_System::url('civicrm/civimobile/settings', http_build_query([]))); CRM_CiviMobileAPI_Utils_Extension::update(); - CRM_Core_Session::setStatus(ts('CiviMobile updated')); + CRM_Core_Session::singleton()->setStatus(ts('CiviMobile updated'), ts('CiviMobile Settings'), 'success'); } } catch (Exception $e) { @@ -195,6 +165,12 @@ class CRM_CiviMobileAPI_Form_Settings extends CRM_Core_Form { } elseif (!empty($params['_qf_Settings_upload'])) { $this->controller->setDestination(CRM_Utils_System::url('civicrm/civimobile/settings', http_build_query([]))); + if (!empty($params['civimobile_auto_update'])) { + Civi::settings()->set('civimobile_auto_update', 1); + } + else { + Civi::settings()->set('civimobile_auto_update', 0); + } if (!isset($params['civimobile_is_allow_public_info_api'])) { $params['civimobile_is_allow_public_info_api'] = 0; } @@ -208,7 +184,7 @@ class CRM_CiviMobileAPI_Form_Settings extends CRM_Core_Form { Civi::settings()->set('civimobile_is_allow_public_website_url_qrcode', $params['civimobile_is_allow_public_website_url_qrcode']); Civi::settings()->set('civimobile_site_name_to_use', $params['civimobile_site_name_to_use']); Civi::settings()->set('civimobile_custom_site_name', $params['civimobile_custom_site_name']); - CRM_Core_Session::setStatus(ts('CiviMobile settings updated')); + CRM_Core_Session::singleton()->setStatus(ts('CiviMobile settings updated'), ts('CiviMobile Settings'), 'success'); } } diff --git a/civimobileapi.php b/civimobileapi.php index b8f6a2a..d79b9f3 100644 --- a/civimobileapi.php +++ b/civimobileapi.php @@ -168,8 +168,10 @@ function civimobileapi_civicrm_apiWrappers(&$wrappers, $apiRequest) { $wrappers[] = new CRM_CiviMobileAPI_ApiWrapper_Membership_Create(); } - if ($apiRequest['action'] == 'getsingle' || $apiRequest['action'] == 'get') { - $wrappers[] = new CRM_CiviMobileAPI_ApiWrapper_Membership_Get(); + if (is_mobile_request()) { + if ($apiRequest['action'] == 'getsingle' || $apiRequest['action'] == 'get') { + $wrappers[] = new CRM_CiviMobileAPI_ApiWrapper_Membership_Get(); + } } } elseif ($apiRequest['entity'] == 'Relationship' && $apiRequest['action'] == 'get') { diff --git a/info.xml b/info.xml index de0414a..60d0764 100644 --- a/info.xml +++ b/info.xml @@ -14,8 +14,8 @@ https://agiliway.com http://www.gnu.org/licenses/agpl-3.0.html - 2020-02-19 - 5.0.0 + 2020-02-26 + 5.0.1 stable 4.7 -- GitLab