-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Joomla Permissions Issue - Slow Performance and Timeouts with Non-Super Users #43649
Comments
This happens because joomla-cms/libraries/src/Access/Access.php Line 269 in 2d99f3b
I set it as bug, however I have no idea how it can be fixed. It probably for all Joomla versions. Cannot find older similar issue about it. |
This comment was marked as outdated.
This comment was marked as outdated.
I tried changing $preload to $preload = false in joomla-cms/libraries/src/Access/Access.php at line 155, but the issue still persists. |
Okay, I think now instead one large DB query you got a few hundrets of small DB queries. That is why it is still slow. Another thing to try is to plreload only needed items, that in the current view. $accessWorkAround = new class () extends \Joomla\CMS\Access\Access
{
// Preload only needed items
public static function verySmartPreload($assetType, $assetsList, $key = 'id')
{
$extensionName = self::getExtensionNameFromAsset($assetType);
/** @var \Joomla\Database\Mysql\MysqlDriver $db */
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
/** @var \Joomla\Database\Mysql\MysqlQuery $query */
$query = $db->getQuery(true);
$query->select($db->quoteName(['id', 'name', 'rules', 'parent_id']))
->from($db->quoteName('#__assets'))
->where(
$db->quoteName($key) . ' IN ('
. implode(',', $query->bindArray($assetsList, \Joomla\Database\ParameterType::STRING)) . ')'
);
$assets = $db->setQuery($query)->loadObjectList();
foreach ($assets as $asset) {
self::$assetPermissionsParentIdMapping[$extensionName][$asset->id] = $asset;
self::$preloadedAssets[$asset->id] = $asset->name;
}
// Temporary mark as preloaded
self::$preloadedAssetTypes[$assetType] = true;
}
public static function resetVerySmartPreload($assetType)
{
unset(self::$preloadedAssetTypes[$assetType]);
}
};
$assetsList = [];
foreach ($this->items as $item) {
$assetsList[] = 'com_content.article.' . $item->id;
if (!empty($item->catid)) {
$assetsList[] = 'com_content.category.' . $item->catid;
}
}
$accessWorkAround::verySmartPreload('com_content.article', $assetsList, 'name'); then at the end of the file: <?php $accessWorkAround::resetVerySmartPreload('com_content.article'); ?> And please tell us if it help. |
Description:
I am experiencing performance issues with Joomla permissions on version 5.1.1. I created a group intended to have backend access, specifically to create or edit content. While everything works fine in general, accessing Content >> Articles is extremely slow and often times out or crashes the page. This issue arises when attempting to list articles. However, this problem does not occur when you log in as a Super User.
Steps to Reproduce:
Expected Result:
The articles list should load efficiently without significant delay or timeouts.
Actual Result:
The page loads extremely slowly, often timing out and crashing.
Debugging Information:
Using the Joomla debugging tool, we discovered that:
Screenshot:
The attached screenshot shows a profile trace comparison:
Attachment
Question:
Can you confirm if this is a bug or native Joomla behavior?
Environment:
Additional Information:
The issue seems to be tied to how Joomla processes permissions for non-Super Users, causing a performance bottleneck when listing a large number of articles. Any insights or workarounds to alleviate this issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered: