VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: marcosis on November 19, 2016, 15:14:09 PM

Title: Module type "VirtueMart Products" returns error 500 - Resolved
Post by: marcosis on November 19, 2016, 15:14:09 PM
Hi Guys,

I have just updated to the latest Joomla and VirtueMart releases and it appears all of my "VirtueMart Products" modules are now broken and unable to load. When I call the modules using "Modules Anywhere" they just fail to appear, and when I assign them directly to a module position, the page simply comes back as Error 500 and doesn't load at all.

Has anyone else experienced this issue since upgrading or is this only my installation that is doing this?

My template also has custom product modules developed by my template designer which still work, so it's just the VirtueMart built in product modules that appear to be affected.

Versions
Virtuemart: 3.0.18
Joomla: 3.6.4

Thanks in advance.
Title: Re: Module type "VirtueMart Products" returns error 500
Post by: jenkinhill on November 19, 2016, 16:19:04 PM
What versions did you update from? Did you install the current aio component as well as the main VM component? What is the actual 500 error recorded in the server log?
Title: Re: Module type "VirtueMart Products" returns error 500
Post by: marcosis on November 19, 2016, 19:57:46 PM
Hi Jenkinhill,

Upgraded from version 3.4.0, I indeed installed both the Core and AIO components.

Error record from my server log:

[19-Nov-2016 18:54:06 UTC] PHP Warning:  require(JPATH_VM_ADMIN/helpers/currencydisplay.php): failed to open stream: No such file or directory in /home/<DIR>/public_html/plugins/system/vpframework/helpers/filter.php on line 128

Line 128 refers to the file "helpers/currencydisplay.php" which is indeed missing on my server. Should this have been installed by the update, or should this have already been there?

Thanks for your help :)
Title: Re: Module type "VirtueMart Products" returns error 500
Post by: GJC Web Design on November 19, 2016, 21:44:07 PM
helpers/currencydisplay.php has been there since VM3.0.0
Title: Re: Module type "VirtueMart Products" returns error 500
Post by: marcosis on November 20, 2016, 06:34:49 AM
Well that doesn't make any sense why it isn't there now, since I wouldn't obviously delete it myself. Maybe VirtueMart might want to check into why it happened?

For the mean time i'll try extract a copy from a fresh install and go from there.

Thanks for the info GJC and Jenkinhill
Title: Re: Module type "VirtueMart Products" returns error 500
Post by: jenkinhill on November 20, 2016, 12:46:41 PM
You were looking in administrator/components/com_virtuemart/helprs/ for the currencydisplay.php file? That's where it should be.

Files do not simply vanish, they have to be deleted!  Are you sure you have not been hacked?
Title: Re: Module type "VirtueMart Products" returns error 500
Post by: marcosis on November 20, 2016, 13:40:49 PM
Yeah, originally I was looking in the plugins directory and thought potentially the file was removed somehow during the upgrade process. That being said I can confirm that the file is safe and sound within "/administrator/components/com_virtuemart/helpers" with permissions set to 644 so I am at a loss as to why it cannot find it.

Is the following correct:

File:
/plugins/system/vpframework/helpers/filter.php

Code:
if(!class_exists('CurrencyDisplay'))
{
require(JPATH_VM_ADMIN. '/helpers/currencydisplay.php');
}


Anyone else with any ideas?
Title: Re: Module type "VirtueMart Products" returns error 500
Post by: jenkinhill on November 20, 2016, 15:09:30 PM
Well the error is generated within /vpframework/ so ask Jumbo, who has been updating templates recently - https://www.virtueplanet.com/forum/announcements/23392-important-update-vp-merchant-responsive-virtuemart-3-template
Title: Re: Module type "VirtueMart Products" returns error 500
Post by: marcosis on November 25, 2016, 16:00:06 PM
Turns out the auto updater package for the template messed something up and simply downloading the full package and manually installing it over the top fixed the issue.

Thanks for your help and for pointing me in the right direction jenkinhill  :)
Title: Re: Module type "VirtueMart Products" returns error 500 - Resolved
Post by: Studio 42 on November 25, 2016, 21:56:52 PM
I think that vm config file is not load, so the path for JPATH_VM_ADMIN cannot be converted.

Add this line before (or before the class
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'config.php');

VmConfig::loadConfig();


perhpas you can remove : VmConfig::loadConfig();