-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #71: Use new 'after_config' hook for Moodle 4.5 #72
Conversation
This change causes an error if
|
classes/hook_callbacks.php
Outdated
* @return void|null | ||
*/ | ||
public static function after_config(\core\hook\after_config $hook) { | ||
if (!get_config('tool_abconfig', 'version')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like you copied the code from tool_abconfig_after_config
. Is there any way to abstract the to avoid code duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right - it is just copy and pasted. As we're not creating separate stable branches and the function of the callback remains the same, we could just call the original tool_abconfig_after_config
function from the new hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @djarran ,
Please update the PR with the call to existing tool_abconfig_after_config, I will review and merge the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tuanngocnguyen, this has been done now. Thank you
Hi @leonstr, thank you for testing this. I have added the check you suggested and the install now continues as usual. |
classes/hook_callbacks.php
Outdated
/** | ||
* Runs after config has been set. | ||
* | ||
* @param \core\hook\before_http_headers $hook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please fix this @param type, I think ci complains about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that, updated this one.
lgtm |
Description: Adds hook for deprecated callback
after_config
. Closes #71