Hi Arno,
I found a reproducible issue in jDownloads 4.1.7 Stable when using multilingual categories.
Environment:
- Joomla 6.1.3
- jDownloads 4.1.7 Stable
- Administrator template: Atum
- Joomla multilingual associations enabled
Problem:
Category associations are correctly stored and work normally.
If I edit a category and open the Associations tab, the associated category in the other language is shown correctly.
However, in:
jDownloads → Categories
the "Associations" column remains empty.
For example:
Spanish category:
Extensiones Gratis → associated with English category "Free Extensions"
English category:
Free Extensions → associated with Spanish category "Extensiones Gratis"
The associations exist in the database and are correctly shown inside the category edit form, but they are not displayed in the Categories list.
I checked the source code in:
administrator/components/com_jdownloads/src/Model/CategoriesModel.php
The getAssoc() method contains:
$assoc = Associations::isEnabled();
if ($assoc)
{
\JLoader::register(
'JdownloadsAssociationsHelper',
JPATH_ADMINISTRATOR . '/components/com_jdownloads/src/Helper/associations.php'
);
$assoc = class_exists('JdownloadsAssociationsHelper');
}
But the actual helper class is namespaced:
JDownloads\Component\JDownloads\Administrator\Helper\JDownloadsAssociationsHelper
Therefore:
class_exists('JdownloadsAssociationsHelper')
can return false.
When that happens, getListQuery() does not add the association JOIN/count:
if ($assoc)
{
$query->select('COUNT(asso2.id)>1 as association')
->join('LEFT', '#__associations AS asso ON asso.id = a.id AND asso.context=' . $db->quote('com_jdownloads.category.item'))
->join('LEFT', '#__associations AS asso2 ON asso2.key = asso.key');
}
and the Categories layout never receives $item->association.
I confirmed this is only a display/listing problem. The category associations themselves are not lost or damaged.
As a test, I created an administrator template override for:
administrator/components/com_jdownloads/tmpl/categories/default.php
and queried the existing associations directly. The Associations column then displays correctly for all Spanish ↔ English category pairs.
So the problem appears to be in CategoriesModel::getAssoc(), not in the stored associations.
Regards,
Andrés
Alamarte Ingeniería