Closed manuq closed 2 years ago
Flagging that I am unable to replicate this when the disabling is done from the command line. @manuq can you paste the script you currently have for when the disabling is happening?
@rtibbles sorry for the delayed answer. I just tried and I also can't replicate it through the command line.
Our current script is hard to follow, but it basically disables the Learn plugin here and later in execution (after some user intervention) Kolibri starts here
By the way we have a silly temporary patch. So this is not blocking us.
The only thing I can think of is if one of the imports from kolibri is somehow setting off the hook registration - but then that should only be happening when the plugins are also registered, which would then give you the runtime error you had seen before.
The link to the script may help with replication though, thanks!
So, the issue appears to be that disabling a plugin also has the unintended side effect of registering its hooks. This doesn't have any effect from the CLI, as it's only registered in memory, but is appearing here. I think I know how to fix this.
@rtibbles thanks so much. I have confirmed that the PR above fixes the issue.
Disabling the Learn plugin doesn't unregister the LearnRedirect hook. Which results in the traceback below. Note that we have a similar plugin with aredirect hook for the same roles, however it's URL is not being returned by the
get_url_by_role()
function inkolibri.core.views
.Errors and logs