diff --git a/Changes.md b/Changes.md index 3657bceb..08dc1ca1 100644 --- a/Changes.md +++ b/Changes.md @@ -3,6 +3,8 @@ History Version 404.1.3 - In development -------------------------------- +1. Fix 'Orphaned sections problem when adding sections', a regression caused by + 'Use section anchors in links when editing - pt 2' - #223. Version 404.1.2.5 - 28/09/2024 ------------------------------ diff --git a/lib.php b/lib.php index 56f267fb..faefb144 100755 --- a/lib.php +++ b/lib.php @@ -1001,10 +1001,11 @@ public function section_deleted() { * @param bool $add Add a section or delete if false. */ protected function change_gnumsections($add) { + $currentsettings = $this->get_settings(); if ($add) { - $newgnumsetions = $this->settings['gnumsections'] + 1; + $newgnumsetions = $currentsettings['gnumsections'] + 1; } else { - $newgnumsetions = $this->settings['gnumsections'] - 1; + $newgnumsetions = $currentsettings['gnumsections'] - 1; } $data = ['gnumsections' => $newgnumsetions]; $this->update_format_options($data);