Skip to content

Commit

Permalink
Tighten criterion used to delete the built-in prototypes to include the
Browse files Browse the repository at this point in the history
string 'BUILTIN' (or BUILT_IN) in the question name to reduce the
risk that users will delete their own prototypes if they've added them
to the system CR_PROTOTYPES category (which is certainly not recommended).
  • Loading branch information
trampgeek committed Nov 12, 2023
1 parent ce4d92a commit 2678cb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/upgradelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function delete_existing_prototypes($systemcontextid) {
JOIN {question} q ON q.id = qv.questionid
WHERE ctx.id=?
AND qc.name='CR_PROTOTYPES'
AND q.name LIKE '%PROTOTYPE_%'";
AND q.name LIKE 'BUILT%IN_PROTOTYPE_%'";
$prototypes = $DB->get_records_sql($query, array($systemcontextid));
foreach ($prototypes as $question) {
$DB->delete_records('question_coderunner_options', array('questionid' => $question->id));
Expand Down

0 comments on commit 2678cb7

Please sign in to comment.