News Show Pro GK5 on J3.6 & PHP 7.x - Deprecated php error

News Show Pro GK5 - flexible, responsive and easily extendable free Joomla module support forum.
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Mon Jul 25, 2016 9:03 am
Using Joomla 3.6 and PHP 7.0.6 Storefront template with Hikashop.

Have updated News Show pro to Version 1.9.3.6

Receiving the following error:
Deprecated: Non-static method NSP_GK5_com_hikashop_Model::getVariants() should not be called statically in /home/rere3197/public_html/modules/mod_news_pro_gk5/data_sources/com_hikashop/model.php on line 367

Line 367 in model.php is:
// load variants
$content = NSP_GK5_com_hikashop_Model::getVariants($content);

Any idea how to fix please?

(PS: Error reporting is set to "None")
User avatar
Junior Boarder

GK User
Tue Jul 26, 2016 12:02 am
I managed to hide the PHP Deprecated error by adding the following to head of templates/gk_TemplateName/layouts/default.php

Code: Select all
error_reporting(0);
ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED);
ini_set('display_errors','Off');


Source: https://www.gavick.com/documentation/jo ... -error-fix

Although hiding is not actually a fix and given that Joomla >3.6 is designed for PHP 7.x it is probably worth repairing the cause of the deprecated error rather than just hiding it.
User avatar
Junior Boarder

teitbite
Sat Jul 30, 2016 11:02 am
Hi

Actually hiding this error message is a correct solution. Deprecated notification are mostly to force new programming ways. In older PHP versions it was a normal practice to call a function couple of times (by using same module over and over for example). Right now PHP is forcing to on programmers to first check if function was loaded before and than use it or not. I believe it is a good practice, but it will take some time till all modules will include such recognition.
User avatar
Moderator

GK User
Wed Nov 30, 2016 12:31 pm
Any news on this new version of the module?
I see in Pagespeed also that this module is not indexed and tehrefore takes a lot of time to be rendered.

Thank you.

Greetings,
Paul
User avatar
Expert Boarder

teitbite
Tue Dec 06, 2016 10:58 am
Hi

There is no need for newer version of this module. Despite of the notices which tries to force a different programming style code is still valid and will work without any problems.

For indexing I'm not sure why it's not indexed for You. Indexing is based on HTML presentation, so I see absolutely no obstacles for this this. Try maybe set creating thumbnails and rise cache value.
User avatar
Moderator


cron