Skip to content

Commit

Permalink
[5.1] Joomla Update : extensions check never ends (from #43226) (#43410)
Browse files Browse the repository at this point in the history
  • Loading branch information
conseilgouz committed May 20, 2024
1 parent e0d355d commit 4cf154d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ private function checkCompatibility($updateFileUrl, $joomlaTargetVersion)
$minimumStability = ComponentHelper::getParams('com_installer')->get('minimum_stability', Updater::STABILITY_STABLE);

$update = new Update();
$update->set('jversion.full', $joomlaTargetVersion);
$update->setTargetVersion($joomlaTargetVersion);
$update->loadFromXml($updateFileUrl, $minimumStability);

$compatibleVersions = $update->get('compatibleVersions');
Expand Down
42 changes: 41 additions & 1 deletion libraries/src/Updater/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,21 @@ class Update
protected $stability;
protected $supported_databases;
protected $php_minimum;
protected $folder;
protected $changelogurl;
public $sha256;
public $sha384;
public $sha512;
protected $section;

/**
* Joomla! target version used by the pre-update check
*
* @var string
* @since __DEPLOY_VERSION__
*/
private $targetVersion;

/**
* Gets the reference to the current direct parent
*
Expand Down Expand Up @@ -372,7 +382,7 @@ public function _endElement($parser, $name)
if (
isset($this->currentUpdate->targetplatform->name)
&& $product == $this->currentUpdate->targetplatform->name
&& preg_match('/^' . $this->currentUpdate->targetplatform->version . '/', $this->get('jversion.full', JVERSION))
&& preg_match('/^' . $this->currentUpdate->targetplatform->version . '/', $this->getTargetVersion())
) {
// Collect information on updates which do not meet PHP and DB version requirements
$otherUpdateInfo = new \stdClass();
Expand Down Expand Up @@ -690,4 +700,34 @@ protected function stabilityTagToInteger($tag)

return Updater::STABILITY_STABLE;
}

/**
* Set extension's Joomla! target version
*
* @param string $version The target version
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function setTargetVersion($version)
{
$this->targetVersion = $version;
}

/**
* Get extension's Joomla! target version
*
* @return string
*
* @since __DEPLOY_VERSION__
*/
public function getTargetVersion()
{
if (!$this->targetVersion) {
return JVERSION;
}

return $this->targetVersion;
}
}

0 comments on commit 4cf154d

Please sign in to comment.