VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Cyber Beginner on February 15, 2019, 09:16:26 AM

Title: Error message on frontend
Post by: Cyber Beginner on February 15, 2019, 09:16:26 AM
Hi,

I'm using Windows 8.1, Joomla! 3.9.2, VirtueMart 3.4.2, PHP Version 7.2.10, XAMPP - installed on local host.

On the frontend, in product view, I get the following error message:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; NewImg2Thumb has a deprecated constructor in C:\xampp\htdocs\bestbox\plugins\vmcustom\imagezoomer\helpers\img2thumb.php on line 22

Do you have any idea what do I need to do for solving this issue?

Thanks in advance for any help!

Denis
Title: Re: Error message on frontend
Post by: Jörgen on February 15, 2019, 09:45:49 AM
Contact imagezoomer, this extension is not PHP 7 ready, deprecated in php 5 (warning) and removed in php 7 (error)

If you know some php look at this, adapt names for the names used in line 22.

class yourClass
{
   // rename yourClass($myparam) to this:   
   public function __construct($myparam)
    {
        // Code from your old yourClass constructor is of course here
    }

   // Leaving this old style constructor is only for backwards compatibility, you can skip this
    public function yourClass($myparam)
    {
        // Only call the renamed constructor for backward compatibility
       self::__construct($myparam);
    }
}


This code is backwards compatible.

Jörgen @ Kreativ Fotografi
Title: Re: Error message on frontend
Post by: Cyber Beginner on February 15, 2019, 11:18:55 AM
Hi Jörgen,

thanks for your response.
Unfortunately, I don't know php, but I deactivated Imagezoomer and so the error message is disappeared.
I'll contact Imagezoome for a solution to this issue.

Have a nice day
Denis
Title: Re: Error message on frontend
Post by: Studio 42 on February 17, 2019, 02:51:47 AM
You can simply edit the file C:\xampp\htdocs\bestbox\plugins\vmcustom\imagezoomer\helpers\img2thumb.php
and change  line 22
public function NewImg2Thumb
to
public function __construct
and save the file
Title: Re: Error message on frontend
Post by: Cyber Beginner on February 18, 2019, 09:52:44 AM
Thanks for your help!
It works!
Awesome!

Denis