News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

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

Started by alamarte, 05.08.2025 17:07:57

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alamarte

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
  •