Joomla 3.x compatibility Improvment suggestion

Phoca Download - download manager
jtechmedical
Phoca Member
Phoca Member
Posts: 13
Joined: 21 Jun 2012, 19:41

Joomla 3.x compatibility Improvment suggestion

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Joomla 3.x compatibility Improvment suggestion

Post 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
If you find Phoca extensions useful, please support the project
jtechmedical
Phoca Member
Phoca Member
Posts: 13
Joined: 21 Jun 2012, 19:41

Re: Joomla 3.x compatibility Improvment suggestion

Post by jtechmedical »

Thanks, Jan. We look forward to seeing the changes in the next version.

All the best,
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Joomla 3.x compatibility Improvment suggestion

Post 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
If you find Phoca extensions useful, please support the project
Post Reply