Page 1 of 1

Joomla 3.x compatibility Improvment suggestion

Posted: 02 Apr 2015, 19:19
by jtechmedical
This is a suggestion for a code improvement to improve Phoca Download 3.0.6 (the specified Joomla 3 version of Phoca Downloads) to be more compliant with Joomla 3.x by removing deprecated code.
(yes, I do know about hiding strict standards issues; Which I do on production sites. but I watch for these issues on my development sites)

The following notices exist in Phoca Download 3.0.6
mod_fcgid: stderr: PHP Strict Standards: Non-static method PhocaDownloadHelperRoute::getFileRoute() should not be called statically, assuming $this from incompatible context in /plugins/content/phocadownload/phocadownload.php on line 552
mod_fcgid: stderr: PHP Strict Standards: Non-static method PhocaDownloadHelperRoute::_findItem() should not be called statically, assuming $this from incompatible context in /components/com_phocadownload/helpers/route.php on line 69
mod_fcgid: stderr: PHP Strict Standards: Non-static method JApplication::getMenu() should not be called statically, assuming $this from incompatible context in /components/com_phocadownload/helpers/route.php on line 245

Change following lines in components/com_phocadownload/helpers/route.php to fix the getMenu notice (and remove deprecated code)
line 245 from

Code: Select all

$menus	=JApplication::getMenu('site', array());
change to

Code: Select all

$menus	= JFactory::getApplication()->getMenu('site', array());
Reason
JApplication::getMenu() is deprecated. JFactory::getApplication()->getMenu() instead.
line 249 from

Code: Select all

return JRequest::getVar('Itemid', 0, '', 'int');
change to

Code: Select all

return JFactory::getApplication()->input->get('Itemid', 0, '', 'int');
Reason
JRequest::getVar() is deprecated. Use JFactory::getApplication()->input->get() instead.

References
Potential backward compatibility issues in Joomla 3 and Joomla Platform 12.2
Joomla 3.0 conversion changes needed when converting a common installable package for “joomla 1.5.x & 2.5.x” to “joomla 3.0
Joomla! CMS 3.4 API Deprecated elements

Re: Joomla 3.x compatibility Improvment suggestion

Posted: 02 Apr 2015, 22:49
by Jan
Hi, thank you, yes, I overwrite the code step by step so some parts are still obsolete.

So, yes, I will change it in the next version.
https://www.phoca.cz/documents/50-phoca/ ... tic-method
Thank you,
Jan

Re: Joomla 3.x compatibility Improvment suggestion

Posted: 26 May 2015, 18:56
by jtechmedical
Thanks, Jan. We look forward to seeing the changes in the next version.

All the best,

Re: Joomla 3.x compatibility Improvment suggestion

Posted: 20 Oct 2015, 00:21
by Jan
Hi, I am working on new version of Phoca Download but I have problems with this issue, I cannot find this file:
components/com_phocadownload/helpers/route.php

Are you sure you run the latest version (3.0.6) in your Joomla! 3 - in Phoca Download 3.0.6 there is no more such file :idea:

The code is not more:
PhocaDownloadHelperRoute::getFileRoute()
but:
PhocaDownloadRoute::getFileRoute()

Jan