News:

Dear jDownloads users, There is currently no Joomla 6 compatible version available. However, we are working on it and hope to release it shortly.

Main Menu
Support-Forum

PHP Warning: Undefined property $category_title in "Most Recently Downloaded" module

Started by Andrés Restrepo, 05.08.2025 17:07:57

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrés Restrepo

When using the mod_jdownloads_most_recently_downloaded module, the following PHP warning appears repeatedly in the logs:

PHP Warning:  Undefined property: stdClass::$category_title in /modules/mod_jdownloads_most_recently_downloaded/tmpl/default.php on line 70

This occurs when the $files[$i] object does not contain the category_title property, usually due to incomplete records or missing categories.

As a consequence, the cPanel error log grows significantly and very quickly, making server management difficult and masking more relevant errors.

Proposed Solution
It is recommended to check if the property exists before accessing it, for example:

$cat_show_text2 = isset($files[$i]->category_title) ? $files[$i]->category_title : '';

This removes the warning and makes the module more robust when handling incomplete data.


Implementation

File: /modules/mod_jdownloads_most_recently_downloaded/tmpl/default.php

Replace every use of
$files[$i]->category_title

For
isset($files[$i]->category_title) ? $files[$i]->category_title : ''

File: /modules/mod_jdownloads_most_recently_downloaded/tmpl/default.php

PHP    8.3.23
mysql  8.0.37
Joomla! 5.3.2
  •  
    The following users thanked this post: Arno

Arno

Hi Andrés,
sorry for the late reply. 

Thank you for your report and the bug fix. I will include it in version 4.49.
However, I wonder why a category should not have a name, as this should not actually be possible.  ::) 
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Arno

Hi Andrés,
I checked it again and found some bugs. For example, I had used incorrect identifiers.
But it should now be correct in v.4.0.49.
Attached the fixed default.php.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!