-
-
Notifications
You must be signed in to change notification settings - Fork 989
[ticket/14831] Fix extension modules installation issues #4491
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
Conversation
public function exists($class, $parent, $module) | ||
{ | ||
// Clear the Modules Cache first to get actual data | ||
$this->cache->destroy("_modules_$class"); |
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.
This doesn't seem to work. Method "destroy" not found in \phpbb\cache\service
Shoud maybe switch to the cache driver interface?
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.
But how did it work before in the add()
method and why tests didn't fail on that, just curious. These things with migrations are all weird 😕
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.
I guess don't change the cache then...All the other tools use the service too. My IDE just pointed that out, but it could be a magic method. Seems tests fail after changing it. |
PHPBB3-14831
It looks like this needs more work as there're some more issues with migrations relying on |
The particular problem is that in case |
public function get_parent_module_id($parent_id, $data = '', $throw_exception = true) | ||
{ | ||
// Initialize exception object placeholder | ||
$e = false; |
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.
Please a better name than just $e
I hope this can be !unset WIP now. |
$parent = $this->get_parent_module_id($parent, $module); | ||
$parent_sql = 'AND parent_id = ' . (int) $parent; | ||
$parent = $this->get_parent_module_id($parent, $module, false); | ||
if ($parent !== false) |
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.
@rxu maybe just
if ($parent === false)
{
return false;
}
$parent_sql = 'AND parent_id = ' . (int) $parent;
to avoid duplicated construction and simplify the code a little bit?
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.
Good catch, agreed.
PHPBB3-14831
[ticket/14831] Fix extension modules installation issues * rxu/ticket/14831: [ticket/14831] Optimize code construction [ticket/14831] Add more tests against UCP modules [ticket/14831] Add more tests, better name for $e placeholder [ticket/14831] Do not throw exception on the module existence checking [ticket/14831] Fix module migrator tool
Checklist:
PHPBB3-14831.