Merge pull request #6380 from colemanw/CRM-16478
authorcolemanw <coleman@civicrm.org>
Sun, 2 Aug 2015 19:53:15 +0000 (15:53 -0400)
committercolemanw <coleman@civicrm.org>
Sun, 2 Aug 2015 19:53:15 +0000 (15:53 -0400)
CRM-16478 - Remove custom fatal error tpl option

CRM/Admin/Form/Setting/Debugging.php
CRM/Core/Config/Variables.php
CRM/Core/Error.php
CRM/Upgrade/Incremental/php/FourSeven.php
CRM/Upgrade/Incremental/sql/4.7.alpha1.mysql.tpl
api/v3/examples/Setting/GetFields.php
settings/Developer.setting.php
templates/CRM/Admin/Form/Setting/Debugging.tpl

index a980afe747503643a6c96bea5f7b460d9bd061d5..993a95faee58d37232e64c0746db1e738397129f 100644 (file)
@@ -42,7 +42,6 @@ class CRM_Admin_Form_Setting_Debugging extends CRM_Admin_Form_Setting {
   protected $_settings = array(
     'debug_enabled' => CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME,
     'backtrace' => CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME,
-    'fatalErrorTemplate' => CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME,
     'fatalErrorHandler' => CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME,
   );
 
index 09f82b2ee563505b82274c2f86ae4fd0fb5e61da..9220bbe3a9740d5021baab000a63b2508d1b25ca 100644 (file)
@@ -363,13 +363,6 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
    */
   public $enableSSL = FALSE;
 
-  /**
-   * Error template to use for fatal errors
-   *
-   * @var string
-   */
-  public $fatalErrorTemplate = 'CRM/common/fatal.tpl';
-
   /**
    * Fatal error handler
    *
index 3afdd9b2067cfc8db54fb41ceb5d26370ab0a14f..24ecba1c65ddd7e1d3dc267921ba5724071748c5 100644 (file)
@@ -378,10 +378,8 @@ class CRM_Core_Error extends PEAR_ErrorStack {
     }
 
     $template = CRM_Core_Smarty::singleton();
-
     $template->assign($vars);
-
-    $config->userSystem->outputError($template->fetch($config->fatalErrorTemplate));
+    $config->userSystem->outputError($template->fetch('CRM/common/fatal.tpl'));
 
     self::abend(CRM_Core_Error::FATAL_ERROR);
   }
@@ -447,7 +445,7 @@ class CRM_Core_Error extends PEAR_ErrorStack {
     // print to screen
     $template = CRM_Core_Smarty::singleton();
     $template->assign($vars);
-    $content = $template->fetch($config->fatalErrorTemplate);
+    $content = $template->fetch('CRM/common/fatal.tpl');
     if ($config->backtrace) {
       $content = self::formatHtmlException($exception) . $content;
     }
index 9398979f9b2d4f297da73dcd015be1d98009f421..71adbb4127c394b249a1beb8bcdb7a6129a45825 100644 (file)
  */
 class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base {
 
+  /**
+   * Compute any messages which should be displayed beforeupgrade.
+   *
+   * Note: This function is called iteratively for each upcoming
+   * revision to the database.
+   *
+   * @param $preUpgradeMessage
+   * @param string $rev
+   *   a version number, e.g. '4.4.alpha1', '4.4.beta3', '4.4.0'.
+   * @param null $currentVer
+   *
+   * @return void
+   */
+  public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) {
+    if ($rev == '4.7.alpha1') {
+
+      // CRM-16478 Remove custom fatal error template path option
+      $config = CRM_Core_Config::singleton();
+      if (!empty($config->fatalErrorTemplate) && $config->fatalErrorTemplate != 'CRM/common/fatal.tpl') {
+        $preUpgradeMessage .= '<p>' . ts('The custom fatal error template setting will be removed during the upgrade. You are currently using this custom template: %1 . Following the upgrade you will need to use the standard approach to overriding template files, as described in the documentation.', array(1 => $config->fatalErrorTemplate)) . '</p>';
+      }
+    }
+  }
+
   /**
    * Compute any messages which should be displayed after upgrade.
    *
@@ -65,6 +89,8 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base
       $postUpgradeMessage .= '<p>' . ts('CiviCRM now includes the easy-to-use CKEditor Configurator. To customize the features and display of your wysiwyg editor, visit the <a %1>Display Preferences</a> page. <a %2>Learn more...</a>', array(1 => $dsp_href, 2 => $blog_href)) . '</p>';
 
       $postUpgradeMessage .= '<br /><br />' . ts('Default version of the following System Workflow Message Templates have been modified: <ul><li>Personal Campaign Pages - Owner Notification</li></ul> If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages).');
+
+      $postUpgradeMessage .= '<p>' . ts('The custom fatal error template setting has been removed.') . '</p>';
     }
   }
 
index 260c07b2728cb0781bc6987b1812eec17f60751f..d9aaee70e3ff67800d18f368ec68a749f2bebea3 100644 (file)
@@ -24,6 +24,9 @@ UPDATE civicrm_option_value SET {localize field="label"}label = 'Activity Summar
 
 {include file='../CRM/Upgrade/4.7.alpha1.msg_template/civicrm_msg_template.tpl'}
 
+-- CRM-16478 Remove custom fatal error template path
+DELETE FROM civicrm_setting WHERE name = 'fatalErrorTemplate';
+
 UPDATE civicrm_state_province SET name = 'Bataan' WHERE name = 'Batasn';
 
 --CRM-16914
@@ -39,4 +42,4 @@ ADD COLUMN
 UPDATE civicrm_country SET `name` = UPPER( `name` );
 
 -- CRM-16447
-UPDATE civicrm_state_province SET name = 'Northern Ostrobothnia' WHERE name = 'Nothern Ostrobothnia';
\ No newline at end of file
+UPDATE civicrm_state_province SET name = 'Northern Ostrobothnia' WHERE name = 'Nothern Ostrobothnia';
index 87a74e7be09fafb9c9f89fec0f1172dd907c0d97..40036da3b562207c61cdaccea4bcb6ea8ca9a726 100644 (file)
@@ -947,21 +947,6 @@ function setting_getfields_expectedresult() {
         'description' => 'Set this value to Yes if you want to display a backtrace listing when a fatal error is encountered. This feature should NOT be enabled for production sites',
         'prefetch' => 1,
       ),
-      'fatalErrorTemplate' => array(
-        'group_name' => 'Developer Preferences',
-        'group' => 'developer',
-        'name' => 'fatalErrorTemplate',
-        'type' => 'String',
-        'quick_form_type' => 'Element',
-        'html_type' => 'text',
-        'default' => 'CRM/common/fatal.tpl',
-        'add' => '4.3',
-        'title' => 'Fatal Error Template',
-        'is_domain' => 1,
-        'is_contact' => 0,
-        'description' => 'Enter the path and filename for a custom Smarty template if you want to define your own screen for displaying fatal errors.',
-        'prefetch' => 1,
-      ),
       'fatalErrorHandler' => array(
         'group_name' => 'Developer Preferences',
         'group' => 'developer',
index cdd2cc471f62fc70eb4895b5d66753743cd0fc48..e462adeb9577a1fbf4c7509a4bb4d9d566f0df5b 100644 (file)
@@ -82,21 +82,6 @@ return array(
     'description' => "Set this value to Yes if you want to display a backtrace listing when a fatal error is encountered. This feature should NOT be enabled for production sites",
     'prefetch' => 1,
   ),
-  'fatalErrorTemplate' => array(
-    'group_name' => 'Developer Preferences',
-    'group' => 'developer',
-    'name' => 'fatalErrorTemplate',
-    'type' => 'String',
-    'quick_form_type' => 'Element',
-    'html_type' => 'text',
-    'default' => 'CRM/common/fatal.tpl',
-    'add' => '4.3',
-    'title' => 'Fatal Error Template',
-    'is_domain' => 1,
-    'is_contact' => 0,
-    'description' => "Enter the path and filename for a custom Smarty template if you want to define your own screen for displaying fatal errors.",
-    'prefetch' => 1,
-  ),
   'fatalErrorHandler' => array(
     'group_name' => 'Developer Preferences',
     'group' => 'developer',
index 22ce0760b1ee22927c5df4ad0a7e99c584eb4cb7..257dcaf4a73a684e8d874f1a0469e6a46c3003bc 100644 (file)
                 <td>{$form.backtrace.html}<br />
                 <span class="description">{ts}<strong>This feature should NOT be enabled for production sites.</strong><br />Set this value to <strong>Yes</strong> if you want to display a backtrace listing when a fatal error is encountered.{/ts}</span></td>
             </tr>
-            <tr class="crm-debugging-form-block-fatalErrorTemplate">
-                <td class="label">{$form.fatalErrorTemplate.label}</td>
-                <td>{$form.fatalErrorTemplate.html}<br />
-                <span class="description">{ts}Enter the path and filename for a custom Smarty template if you want to define your own screen for displaying fatal errors.{/ts}</span></td>
-            </tr>
             <tr class="crm-debugging-form-block-fatalErrorHandler">
                 <td class="label">{$form.fatalErrorHandler.label}</td>
                 <td>{$form.fatalErrorHandler.html}<br />