1

I'm using the Artio Joomsef component with the Virtuemart plugin mainly for sitemap manipulation, however every time I enable it i get the following error in the product pages:

Deprecated: Non-static method JoomSefLogger::Log() should not be called statically, assuming $this from incompatible context in /mnt/data/vhosts/mydomain/httpdocs/components/com_sef/sef_ext/com_virtuemart.php on line 404

This error relates to the below function:

Function GetProductManufacturerId($productId)
{
    $database = JFactory::getDBO();

    $database->setQuery("SELECT `virtuemart_manufacturer_id` FROM `#__virtuemart_product_manufacturers` WHERE `virtuemart_product_id` = '{$productId}'");
    $mId = $database->loadResult();
    if (is_null($mId)) {
        JoomSefLogger::Log("Manufacturer for product ID {$productId} not found.", $this, 'com_virtuemart');
    }

    return $mId;
}

Is there a way to modify the function so that the error no longer shows? Unfortunately, Artio does not provide support for the extension unless you buy it as a top up to the component itself, and the support forum isn't very active.

I'm not hot with php so i'm hoping someone could provide some advise so I can update the code with and use an override to ensure it doesn't reappear.

This is running on Joomla 3.6.4 VM 3.0.18 and php 5.6.

Thank you in advance Donna

1

It's a warning rather than an error, so it shouldn't be breaking your site and the simplest solution would be to turn off strict error reporting (error reporting should really be turned off any live site anyway.)

From php.net:

In PHP 5, calling non-static methods statically generates an E_STRICT level warning

In PHP 7, calling non-static methods statically is deprecated, and will generate an E_DEPRECATED warning. Support for calling non-static methods statically may be removed in the future.

Changing JoomSefLogger::Log to (new JoomSefLogger)->Log may fix it, as might making the JoomSefLogger function static. Note that any patches in future may override such changes, however.

That said, I think the most sensible solution would be to

  1. Make sure both Virtuemart and the Plugin are patched to the latest version in case it has already been fixed.
  2. Contact the developer to let them know their plug-in is throwing an error. I see it is a paid-for plug-in, so you'd hope they would have some responsibility to their users to do bug fixing.
  • Thank you. I've created a php.ini and added the code to restrict error reporting. It is already switched off in Joomla. I've contacted the developer but I'm not hopeful. Its a shame really as this use to be a great component. – Dtorr1981 Dec 6 '16 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.