Commit e18554d5 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer

Version 1.0: Tiny system plugin to make sure VM is loaded during plugin...

Version 1.0: Tiny system plugin to make sure VM is loaded during plugin updates from the Joomla plugin updater component
This diff is collapsed.
PLUGINFILES=$(BASE).php $(BASE).xml index.html
SYSTRANSLATIONS=$(call wildcard,language/*/*.plg_$(PLUGINTYPE)_$(BASE).*sys.ini)
TRANSLATIONS=$(SYSTRANSLATIONS) $(NONSYSTRANSLATIONS) $(call wildcard,language/*/index.html)
all: zip
$(NONSYSTRANSLATIONS): %.ini: %.sys.ini
cp $< $@
@echo "Packing all files into distribution file $(ZIPFILE):"
rm -f $(ZIPFILE)
* @plugin vmLoaderPluginUpdate
* Version 1.0, 2017-08-06
* @author Reinhold Kainhofer, Open Tools
* @copyright Copyright (C) 2017 Reinhold Kainhofer - All rights reserved.
* @license - 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' );
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');
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.0" type="plugin" group="system" method="upgrade">
<name>VM Framework Loader during Plugin Updates</name>
<author>Reinhold Kainhofer</author>
<copyright>Copyright (C) 2017 Reinhold Kainhofer.</copyright>
<license> GNU/GPL v3+</license>
<description>Makes sure the VirtueMart framework is loaded during automatic plugin updates using Joomla's plugin updater.</description>
<filename plugin="vmLoaderPluginUpdate">vmLoaderPluginUpdate.php</filename>
<!--server type="extension" name="VM Auto Parent Categories Updates"><![CDATA[;extension=vmLoaderPluginUpdate&amp;file=extension.xml]]></server-->
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment