From 881670d92cdb259ac3aebdc1f9fde3472f66041d Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 22 Dec 2020 09:59:39 -0800 Subject: [PATCH] Catch any debugger errors that could occur during Github sync. Added more deprecated items to the log. --- .../shortcodes/batch/admin_shortcodes.php | 11 +++++++- e107_handlers/db_debug_class.php | 2 +- e107_handlers/e_parse_class.php | 28 ++++--------------- e107_themes/bootstrap3/theme.xml | 2 +- 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index c18d91050..1d5dec978 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -747,7 +747,16 @@ class admin_shortcodes return null; } - $items = e107_debug::getAliases(); + try + { + $items = e107_debug::getAliases(); + } + catch (Exception $e) + { + e107::getDebug()->log($e->getMessage()); + return null; // likely during a github update. + } + $current = e107_debug::getShortcut(); $currentAlias = !empty($items[$current]) ? " (".$items[$current].")" : ''; diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php index 11958b0ac..5a57175c7 100644 --- a/e107_handlers/db_debug_class.php +++ b/e107_handlers/db_debug_class.php @@ -109,7 +109,7 @@ $this->ShowIf('SQL Analysis', $this->Show_SQL_Details()); $this->ShowIf('Shortcodes / BBCode', $this->Show_SC_BB()); $this->ShowIf('Paths', $this->Show_PATH()); - $this->ShowIf('Deprecated Methods/Function Usage', $this->Show_DEPRECATED()); + $this->ShowIf('Deprecated Methods/Functions', $this->Show_DEPRECATED()); if(E107_DBG_INCLUDES) { diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 11d7872a4..57bf1074c 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -6096,42 +6096,28 @@ class textparse { public function editparse($text, $mode = 'off') { - if(E107_DBG_DEPRECATED) - { - e107::getDebug()->logDeprecated(); - } + trigger_error(''.__METHOD__.' is deprecated. Use e107::getParser()->toForm($text) instead. ', E_USER_DEPRECATED); return e107::getParser()->toForm($text); } public function tpa($text, $mode = '', $referrer = '', $highlight_search = false, $poster_id = '') { - if(E107_DBG_DEPRECATED) - { - e107::getDebug()->logDeprecated(); - } + trigger_error(''.__METHOD__.' is deprecated. Use e107::getParser()->toHTML($text) instead. ', E_USER_DEPRECATED); return e107::getParser()->toHTML($text, true, $mode, $poster_id); } public function tpj($text) { - - if(E107_DBG_DEPRECATED) - { - e107::getDebug()->logDeprecated(); - } + trigger_error(''.__METHOD__.' is deprecated. ', E_USER_DEPRECATED); return $text; } public function formtpa($text, $mode = '') { - - if(E107_DBG_DEPRECATED) - { - e107::getDebug()->logDeprecated(); - } + trigger_error(''.__METHOD__.' is deprecated. Use e107::getParser()->toDB($text) instead. ', E_USER_DEPRECATED); unset($mode); // keep PHPStorm happy @@ -6140,11 +6126,7 @@ class textparse { public function formtparev($text) { - - if(E107_DBG_DEPRECATED) - { - e107::getDebug()->logDeprecated(); - } + trigger_error(''.__METHOD__.' is deprecated. Use e107::getParser()->toForm($text) instead. ', E_USER_DEPRECATED); return e107::getParser()->toForm($text); } diff --git a/e107_themes/bootstrap3/theme.xml b/e107_themes/bootstrap3/theme.xml index f522461fb..f95b6dea8 100644 --- a/e107_themes/bootstrap3/theme.xml +++ b/e107_themes/bootstrap3/theme.xml @@ -30,7 +30,7 @@ - +