From 2f319afb333b53aae6e0cb8133f398e34b8306ff Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 28 Sep 2006 01:34:07 +0000 Subject: [PATCH] r1197: - Fixing the API so we don't have verification errors; we only need to check the keystring on insert - Add an upgrade task that updates the help text for newreply --- includes/api_userhelp.php | 16 +++++++++++++++- install/upgrade5.php | 13 +++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/includes/api_userhelp.php b/includes/api_userhelp.php index 2bf72a7..1ecf45b 100644 --- a/includes/api_userhelp.php +++ b/includes/api_userhelp.php @@ -40,7 +40,7 @@ class UserHelpAPI extends API * @access private */ var $fields = array( - 'keystring' => array(TYPE_STR, REQ_YES, ':self'), + 'keystring' => array(TYPE_STR, REQ_AUTO), 'title' => array(TYPE_STR, REQ_YES, 'verify_noempty'), 'body' => array(TYPE_STR, REQ_YES) ); @@ -87,6 +87,20 @@ class UserHelpAPI extends API ); } + // ################################################################### + /** + * Pre-insert + * + * @access private + */ + function pre_insert() + { + if (($err = $this->verify_keystring()) !== true) + { + $this->error($err); + } + } + // ################################################################### /** * Post-insert diff --git a/install/upgrade5.php b/install/upgrade5.php index 2457c0c..806ca52 100644 --- a/install/upgrade5.php +++ b/install/upgrade5.php @@ -60,6 +60,19 @@ if ($bugsys->in['mark'] == 1) build_automations(); echo "Rebuilding the automations cahce
\n"; + + $topic = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = 'newreply'"); + if (md5($topic['body']) == '7e1154340454ca6d8f8ba47aab057c23') + { + $topic = $db->query("UPDATE " . TABLE_PREFIX . "fieldhelp SET body = 'Here you can specify additional comments. If you do not change any fields, this will merely attach a comment. + +The \"Automation\" drop-down next to this box (which may be hidden) will allow you to perform a common task. These administrator-defined tasks can change any of the bug fields automatically and then add an automatic reply. If you change a field that will be altered by the action, the action\'s change will take precedence. Also, if you enter a comment and the action specifies a comment, the automatic comment will be attached to yours.' WHERE keystring = 'newreply'"); + echo "Updating user help topic on new replies
\n"; + } + else + { + echo "ALERT: You have modified your user help topic for newreply which means that the help item was not updated for the renaming of 'Automatic Action' to 'Automation'
\n"; + } } // ################################################################### -- 2.22.5