Skip to content

Commit

Permalink
MDL-59980 core_admin: Fix bug preventing block modification in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristian Ringer committed Jun 12, 2018
1 parent 50e48a8 commit c0bc8d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
$statusmsg = '';
$errormsg = '';

if ($data = data_submitted() and confirm_sesskey()) {
// Form is submitted with changed settings. Do not want to execute when modifying a block.
if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and $data->action == 'save-settings') {

$count = admin_write_settings($data);
// Regardless of whether any setting change was written (a positive count), check validation errors for those that didn't.
Expand Down
1 change: 1 addition & 0 deletions admin/templates/settings.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<div class="settingsform clearfix">
{{#params}}
<input type="hidden" name="{{name}}" value="{{value}}">
<input type="hidden" name="action" value="save-settings">
{{/params}}
<input type="hidden" name="sesskey" value="{{sesskey}}">
<input type="hidden" name="return" value="{{return}}">
Expand Down
1 change: 1 addition & 0 deletions theme/boost/templates/core_admin/settings.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<div class="settingsform">
{{#params}}
<input type="hidden" name="{{name}}" value="{{value}}">
<input type="hidden" name="action" value="save-settings">
{{/params}}
<input type="hidden" name="sesskey" value="{{sesskey}}">
<input type="hidden" name="return" value="{{return}}">
Expand Down

0 comments on commit c0bc8d3

Please sign in to comment.