Skip to content

Commit

Permalink
Add a check for allowing downgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Apr 14, 2014
1 parent 2990423 commit c41e5f5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libraries/cms/helper/extensionscript.php
Expand Up @@ -66,6 +66,13 @@ class JExtensionscriptHelper
*/
protected $minimumJoomla;

/**
* @var boolean Allow downgrades of your extension. Use at your own risk
* as if there is a change in functionality people may wish
* to downgrade
*/
protected $allowDowngrades = false;

/**
* Function called before module installation/update/removal procedure commences
*
Expand Down Expand Up @@ -106,7 +113,7 @@ public function preflight($type, $parent)
}

// Abort if the module being installed is not newer than the currently installed version
if ($type == 'Update')
if ($type == 'Update' && $this->allowDowngrades)
{
$manifest = $this->getItemArray('manifest_cache', '#__extensions', 'element', JFactory::getDbo()->quote($this->extension));
$oldRelease = $manifest['version'];
Expand Down

0 comments on commit c41e5f5

Please sign in to comment.