CMS MADE SIMPLE FORGE

JMDownMan

 

[#12553] cms_db_prefix() missing in JMDownMan.module.php in GetSubCategories() function

avatar
Created By: Simon (creopard)
Date Submitted: Sat Jul 23 16:09:14 -0400 2022

Assigned To: Fernando Morgado (JoMorg)
Version: 1.RC.2
CMSMS Version: 2.2.16
Severity: Major
Resolution: None
State: Open
Summary:
cms_db_prefix() missing in JMDownMan.module.php in GetSubCategories() function
Detailed Description:
the line says:
$q = 'SELECT *, COUNT(file_id) AS filesnb FROM
cms_module_jmdownman_categories c
LEFT JOIN '.cms_db_prefix().'module_jmdownman_files_category USING
(category_id)
    ' .($where!==false? 'WHERE '.$where:'').
    'GROUP BY category_id ORDER BY c.hierarchy_priority';


but it should be instead:
$q = 'SELECT *, COUNT(file_id) AS filesnb FROM
'.cms_db_prefix().'cms_module_jmdownman_categories c
LEFT JOIN '.cms_db_prefix().'module_jmdownman_files_category USING
(category_id)
    ' .($where!==false? 'WHERE '.$where:'').
    'GROUP BY category_id ORDER BY c.hierarchy_priority';


here's the backtrace from /tmp/cache/debug.log:

GetSubCategories at /home/public_html/modules/JMDownMan/action.default.php:60
Execute at /home/public_html/modules/JMDownMan/JMDownMan.module.php:548
SelectLimit at /home/public_html/lib/classes/Database/class.Connection.php:341
do_sql at /home/public_html/lib/classes/Database/class.Connection.php:328
OnError at
/home/public_html/lib/classes/Database/mysqli/class.Connection.php:127
call_user_func at
/home/public_html/lib/classes/Database/class.Connection.php:678
on_error
Debug: (0.015948) - (net usage: 6136776) - (peak: 7111672)
Database Error: EXECUTE(1146) - Table 'cmsms2.cms_module_jmdownman_categories'
doesn't exist


History