-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
XOOPS reads blocks from deactivated modules #1335
Comments
Nice find! |
Indeed, this behaviour is not good. |
I didn't have the time to investigate it in detail, because the module was outdated, so I just wanted to get XOOPS to work.
In my case, it was crashing, until I went to the module's block and deactivated If you can't replicate it this way, let me know, and I'll try to investigate in more depth on my end |
Okay, I'll take a look and let you know if I have a problem |
I added an error in the templates of a block of the xmnews module and the site does not work anymore. I deactivate the module and the site works. I can't reproduce the problem... |
OK, I'll take a look here this weekend. |
Do you have any other information? Because I couldn't reproduce your problem! |
Still on my TODO list, and didn't have the time to get to it yet :( |
OK, I finally was able to identify the issue - the problem was in this method in \kernel\block.php: public function getAllByGroupModule($groupid, $module_id = 0, $toponlyblock = false, $visible = null, $orderby = 'b.weight, m.block_id', $isactive = 1) in this query: $sql = 'SELECT b.* FROM ' . $db->prefix('newblocks') . ' b, ' . $db->prefix('block_module_link') . ' m WHERE m.block_id=b.bid';
$sql .= ' AND b.isactive=' . $isactive; because it was selecting all blocks in the Once I've added a check if the module is active: $sql = 'SELECT b.* FROM ' . $db->prefix('newblocks') . ' b
JOIN ' . $db->prefix('block_module_link') . ' m ON m.block_id = b.bid
JOIN ' . $db->prefix('modules') . ' mo ON mo.mid = b.mid
WHERE b.isactive =' . $isactive . ' AND mo.isactive =' . $isactive; it is working now correctly. Next step is to check if there are any parts of XOOPS or XOOPS modules that use this method and if it breaks them If you could do any tests on your part, that would be great! |
I was getting the same error as in #1329
I deactivated all modules, but the error was still there. From the error report, I saw that it complained about a block from a deactivated module. I had to go and deactivate the block, and then the error went away.
We should make sure that XOOPS doesn't read any blocks from deactivated modules. It's a waste of time as it reads blocks that are not going to be displayed, but also it will continue to report errors, incl. fatal errors, even if we deactivate a module because it was buggy
The text was updated successfully, but these errors were encountered: