News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

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.
  •