News:

Support the VirtueMart project and become a member

Main Menu

Virtuemart uninstall causing updates to fail

Started by pschmehl, October 05, 2017, 04:51:33 AM

Previous topic - Next topic

pschmehl

I installed the current version of Virtuemart on Joomla 3.8.1 to try it out. Then I uninstalled it. Apparently the uninstall didn't completely uninstall Virtuemart, because I'm getting the following error when I try to update plugins:
QuoteWarning: require(Sites/www.vvfh.org/administrator/components/com_virtuemart/helpers/config.php): failed to open stream: No such file or directory in Sites/www.vvfh.org/plugins/system/vmLoaderPluginUpdate/vmLoaderPluginUpdate.php on line 38 Fatal error: require(): Failed opening required 'Sites/www.vvfh.org/administrator/components/com_virtuemart/helpers/config.php' (include_path='.:/usr/local/share/pear') in Sites/www.vvfh.org/plugins/system/vmLoaderPluginUpdate/vmLoaderPluginUpdate.php on line 38
I checked the database and discovered that all of the Virtuemart tables are still there.

Is that normal? Is there a script to remove them? I'd rather not remove them one at a time.

pschmehl

I went into plugins/system/vmLoaderPluginUpdate/vmLoaderPluginUpdate.php and edited it, commenting out the offending section. Is this a virtuemart file? Why were the database tables not removed when I ran the uninstall? Is that normal for Joomla extensions?

/**
* @plugin vmLoaderPluginUpdate
* Version 1.0, 2017-08-06
* @author Reinhold Kainhofer, Open Tools
* @copyright Copyright (C) 2017 Reinhold Kainhofer - All rights reserved.
* @license - http://www.gnu.org/licenses/gpl.html GNU/GPL

* The Joomla 3.7+ plugin updater tries to load the plugin before
* updating. Since many plugins in the past assumed that they could only
* be loaded from within VM, the plugins never load the VM framework,
* so loading the plugin from the updater fails.
*
* This plugin makes sure that, when a plugin update is run, the VM
* config is loaded properly.
**/

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport('joomla.event.plugin');

class plgSystemVmLoaderPluginUpdate extends JPlugin {
        function __construct(&$subject, $config = array()) {
                parent::__construct($subject, $config);
                # Only for Joomla 3.7 and above:
                # If a plugin update is run (option=com_installer&view=update&task=update.update),
                # then load the VM config. This approach will load VM even for non-VM
                # plugins, but the overhead of checking whether the updated plugin
                # really requires VM is way too large compared to the performance hit
                # of loading VM even for non-VM plugins.
                if(version_compare(JVERSION,'3.7.0','ge')) {
                        $jinput = JFactory::getApplication()->input;
                        $option = $jinput->get('option');
                        $view = $jinput->get('view');
                        $task = $jinput->get('task');
/**                     if ($option == 'com_installer' && $view == 'update' && $task == 'update.update') {
                                if (!class_exists( 'VmConfig' )) {
                                        require(JPATH_ADMINISTRATOR .'/components/com_virtuemart/helpers/config.php');
                                        VmConfig::loadConfig();
                                }
                        } **/
                }
        }

}

jenkinhill

Yes, vmLoaderPluginUpdate is a VirtueMart system plugin.  Uninstalling is covered in  this:  http://forum.virtuemart.net/index.php?topic=134060.msg465429#msg465429
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

pschmehl

Thanks. That was very helpful. Is there a script to remove the db tables? I don't use phpmyadmin. I prefer not to expose the db to the internet in any way, so I always listen on localhost only and do all my db work from the commandline.

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Studio 42

For the DB, you had to remove it before uninstall Virtuemart.(easy way > install again VM > in tools : "remove database" and uninstall VM after)
For any plugin, you can disable it, if the admin is full broken, simply rename the right plugin folder and it's not loaded anymore.