Skip to content

Commit

Permalink
Issue #73: Include lib file, don't execute callback if $CFG->upgrader…
Browse files Browse the repository at this point in the history
…unning
  • Loading branch information
djarran committed Dec 20, 2024
1 parent fb793c4 commit 89fed85
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion classes/hook_callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

namespace tool_abconfig;

require_once($CFG->dirroot . '/admin/tool/abconfig/lib.php');

/**
* Hook callbacks for tool_abconfig.
*
Expand Down Expand Up @@ -61,7 +63,7 @@ public static function before_footer_html_generation(\core\hook\output\before_fo
* @return void|null
*/
public static function after_config(\core\hook\after_config $hook) {
if (during_initial_install() || !get_config('tool_abconfig', 'version')) {
if (during_initial_install() || isset($CFG->upgraderunning) || !get_config('tool_abconfig', 'version')) {
// Do nothing if plugin install not completed.
return;
}
Expand Down

0 comments on commit 89fed85

Please sign in to comment.