From 4015cb2d0549f81ca9be2b7daf44f0cc6726c2a1 Mon Sep 17 00:00:00 2001 From: Adam Olley Date: Tue, 25 Sep 2018 09:52:17 +0930 Subject: [PATCH] MDL-63891 assignfeedback_editpdf: integration cleanup * Add a note to upgrade.php to notify devs/admins of the new setting. * Replace update_record with set_field. * Add missing phpdoc. Backport of MDL-57610. --- lib/upgrade.txt | 7 +++++-- mod/assign/feedback/editpdf/classes/event/observer.php | 2 +- .../feedback/editpdf/classes/task/convert_submissions.php | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/upgrade.txt b/lib/upgrade.txt index 5863f74018a..479feb51781 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -4,9 +4,12 @@ information provided here is intended especially for developers. === 3.5.4 === * New optional parameter $context for the groups_get_members_join() function and ability to filter users that are not members of -any group. Besides, groups_get_members_ids_sql, get_enrolled_sql and get_enrolled_users now accepts -1 (USERSWITHOUTGROUP) for -the groupid field. + any group. Besides, groups_get_members_ids_sql, get_enrolled_sql and get_enrolled_users now accepts -1 (USERSWITHOUTGROUP) for + the groupid field. * The method core_user::is_real_user() now returns false for userid = 0 parameter +* Added $CFG->conversionattemptlimit setting to config.php allowing a maximum number of retries before giving up conversion + of a given document by the assignfeedback_editpdf\task\convert_submissions task. Default value: 3. + === 3.5.2 === diff --git a/mod/assign/feedback/editpdf/classes/event/observer.php b/mod/assign/feedback/editpdf/classes/event/observer.php index 9797154df9b..0aa8f73d9f3 100644 --- a/mod/assign/feedback/editpdf/classes/event/observer.php +++ b/mod/assign/feedback/editpdf/classes/event/observer.php @@ -48,7 +48,7 @@ class observer { /** * Queue the submission for processing. - * @param $event The submission created/updated event. + * @param \mod_assign\event\base $event The submission created/updated event. */ protected static function queue_conversion($event) { global $DB; diff --git a/mod/assign/feedback/editpdf/classes/task/convert_submissions.php b/mod/assign/feedback/editpdf/classes/task/convert_submissions.php index c8c1a270b88..74a781c7174 100644 --- a/mod/assign/feedback/editpdf/classes/task/convert_submissions.php +++ b/mod/assign/feedback/editpdf/classes/task/convert_submissions.php @@ -70,8 +70,8 @@ class convert_submissions extends scheduled_task { // Record that we're attempting the conversion ahead of time. // We can't do this afterwards as its possible for the conversion process to crash the script entirely. - $record->attemptedconversions++; - $DB->update_record('assignfeedback_editpdf_queue', $record); + $DB->set_field('assignfeedback_editpdf_queue', 'attemptedconversions', + $record->attemptedconversions + 1, ['id' => $record->id]); $assignmentid = $submission->assignment; $attemptnumber = $record->submissionattempt;