Skip to content

Commit

Permalink
MDL-82359 Install: Change default for navadduserpostslinks if no forum
Browse files Browse the repository at this point in the history
If forum is not available, there are debug warnings due to missing
language strings on every page while logged in, unless the
'navadduserpostslinks' setting is turned off. By default this setting
is on.

This change makes the default be on if forum is present (as current),
but off if it is not.

This change is a minimal workaround so that Moodle does not give errors
on every page and we can at least run some Behat tests.
  • Loading branch information
sammarshallou committed Jul 15, 2024
1 parent f447c8b commit 39e6a3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion admin/settings/appearance.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@
$temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', new lang_string('usesitenameforsitepages', 'admin'), new lang_string('configusesitenameforsitepages', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('navshowfrontpagemods', new lang_string('navshowfrontpagemods', 'admin'), new lang_string('navshowfrontpagemods_help', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks', new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'), 1));
// The navadduserpostslinks causes warnings on every page if forum is not present, so we will
// default to false if forum has been removed.
$temp->add(new admin_setting_configcheckbox('navadduserpostslinks',
new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'),
\core_component::get_component_directory('mod_forum') !== null));

$ADMIN->add('appearance', $temp);

Expand Down

0 comments on commit 39e6a3d

Please sign in to comment.