jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => General => Topic started by: ddjenkins on 19.09.2014 04:54:39

Title: Latest Module showing Warning: trim() error
Post by: ddjenkins on 19.09.2014 04:54:39
- 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]
Title: Re: Latest Module showing Warning: trim() error
Post by: ColinM on 19.09.2014 18:15:17
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
Title: Re: Latest Module showing Warning: trim() error
Post by: ColinM on 19.09.2014 22:44:23
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
Title: Re: Latest Module showing Warning: trim() error
Post by: ddjenkins on 20.09.2014 02:21:32
Thanks Colin, that indeed fixed it. I'll close this thread.