Skip to content

Commit 32fe12d

Browse files
Fixed error message when not enabled
1 parent 627130c commit 32fe12d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

db_replace.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
redirect($redirect);
5151
} else if (!(get_config('tool_advancedreplace', 'allowuireplace'))) {
5252
echo $OUTPUT->heading(get_string('replacepageheader', 'tool_advancedreplace'));
53-
echo html_writer::div(get_string('replace_warning', 'tool_advancedreplace'), 'alert alert-warning');
53+
echo html_writer::div(get_string('replace_warning', 'tool_advancedreplace',
54+
'$CFG->forced_plugin_settings[\'tool_advancedreplace\'][\'allowuireplace\'] = 1;'), 'alert alert-warning');
5455
} else if ($csvcontent = ($form->get_file_content('csvfile') ?? $csvpostcontent)) {
5556
$returnurl = new moodle_url('/admin/tool/advancedreplace/db_replace.php');
5657
$optionsyes = array('replace' => $replace, 'confirm' => 1, 'sesskey' => sesskey(), 'csvpostcontent' => $csvcontent);

lang/en/tool_advancedreplace.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
$string['replacepagename'] = 'Replace strings in the Database';
9494
$string['replace'] = 'Replace';
9595
$string['replacecheck'] = 'Are you sure you want to replace strings in the Database using the uploaded csv file?';
96-
$string['replace_warning'] = 'Replace via UI not enabled, to enable please set <b>allowuireplace</b> to true in config.php';
96+
$string['replace_warning'] = 'Replace via UI not enabled, to enable please set <code>{$a}</code> to true in config.php';
9797
$string['strftimedatetimemonthshort'] = '%d %b %Y, %I:%M %p';
9898
$string['searchdeleted'] = 'The selected search was deleted.';
9999
$string['searchpagename'] = 'Search in the Database';

0 commit comments

Comments
 (0)