CRM-19293: Dashboard options disappear after CiviContribute Component Settings save
authoryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 1 Sep 2016 10:13:30 +0000 (15:43 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 8 Sep 2016 08:24:11 +0000 (13:54 +0530)
----------------------------------------
* CRM-19293: Dashboard options disappear after CiviContribute Component Settings save
  https://issues.civicrm.org/jira/browse/CRM-19293

CRM/Admin/Form/Preferences/Contribute.php

index 3d484f7541a02a9b5408237bbdc47d594ba36673..d8a10303884ebe725b00f28d7811ff9c63b95171 100644 (file)
@@ -248,7 +248,9 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
     else {
       $setting = explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($values['user_dashboard_options'], 1, -1));
       $invoiceKey = array_search($setKey, $setting);
-      unset($setting[$invoiceKey]);
+      if (!empty($invoiceKey)) {
+        unset($setting[$invoiceKey]);
+      }
       $settingName = CRM_Core_DAO::VALUE_SEPARATOR .
         implode(CRM_Core_DAO::VALUE_SEPARATOR, array_values($setting)) .
         CRM_Core_DAO::VALUE_SEPARATOR;