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

Latest Module showing Warning: trim() error

Started by ddjenkins, 19.09.2014 04:54:39

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ddjenkins

- The Joomla! Release version! 3.3.3
- The used jDownloads version! 3.2.11
- System Information: PHP, MySQL and version numbers for each (important!) PHP 5.4.32 SQL 5.5.37-35
- Whether your site is Localhost (XAMPP, WAMP for example). Apache, via hosting provider justhost.com

I've just updated my site to jdownlaod 3.2 from 1.9 & have some issues.
The Latest Download module is giving me some SQL error, saying Warning: trim() expects parameter 1 to be string, array given in /home5/pdarcsco/public_html/modules/mod_jdownloads_latest/mod_jdownloads_latest.php on line 28

The module then continues to function OK. I've attached a screen capture of the error. This can also be seen live at www.pdarcs.com.au just scroll to the bottom of the page.

[gelöscht durch Administrator]
  •  

ColinM

Hi
Thanks for reporting always help.  This is also a known error, (actually a php warning - not SQL).  You can suppress it by raising the PHP error/warning level.  It will get resolved.
Colin
Colin M
  •  

ColinM

Hi
If you are able can you please change line 28 of mod_jdownloads_latest.php
from
   $cat_id                = trim($params->get( 'cat_id' ) );
to
   $cat_id                = trim((string)($params->get( 'cat_id' )) );


This should remove the warning message as the $params->.... is cast as a string.
Please advise if this worked OK.
Colin
Colin M
  •  

ddjenkins

Thanks Colin, that indeed fixed it. I'll close this thread.
  •