Skip to content

Commit 4cf154d

Browse files
author
conseilgouz
authored
[5.1] Joomla Update : extensions check never ends (from #43226) (#43410)
1 parent e0d355d commit 4cf154d

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

administrator/components/com_joomlaupdate/src/Model/UpdateModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,7 @@ private function checkCompatibility($updateFileUrl, $joomlaTargetVersion)
16321632
$minimumStability = ComponentHelper::getParams('com_installer')->get('minimum_stability', Updater::STABILITY_STABLE);
16331633

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

16381638
$compatibleVersions = $update->get('compatibleVersions');

libraries/src/Updater/Update.php

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,21 @@ class Update
256256
protected $stability;
257257
protected $supported_databases;
258258
protected $php_minimum;
259+
protected $folder;
260+
protected $changelogurl;
259261
public $sha256;
260262
public $sha384;
261263
public $sha512;
262264
protected $section;
263265

266+
/**
267+
* Joomla! target version used by the pre-update check
268+
*
269+
* @var string
270+
* @since __DEPLOY_VERSION__
271+
*/
272+
private $targetVersion;
273+
264274
/**
265275
* Gets the reference to the current direct parent
266276
*
@@ -372,7 +382,7 @@ public function _endElement($parser, $name)
372382
if (
373383
isset($this->currentUpdate->targetplatform->name)
374384
&& $product == $this->currentUpdate->targetplatform->name
375-
&& preg_match('/^' . $this->currentUpdate->targetplatform->version . '/', $this->get('jversion.full', JVERSION))
385+
&& preg_match('/^' . $this->currentUpdate->targetplatform->version . '/', $this->getTargetVersion())
376386
) {
377387
// Collect information on updates which do not meet PHP and DB version requirements
378388
$otherUpdateInfo = new \stdClass();
@@ -690,4 +700,34 @@ protected function stabilityTagToInteger($tag)
690700

691701
return Updater::STABILITY_STABLE;
692702
}
703+
704+
/**
705+
* Set extension's Joomla! target version
706+
*
707+
* @param string $version The target version
708+
*
709+
* @return void
710+
*
711+
* @since __DEPLOY_VERSION__
712+
*/
713+
public function setTargetVersion($version)
714+
{
715+
$this->targetVersion = $version;
716+
}
717+
718+
/**
719+
* Get extension's Joomla! target version
720+
*
721+
* @return string
722+
*
723+
* @since __DEPLOY_VERSION__
724+
*/
725+
public function getTargetVersion()
726+
{
727+
if (!$this->targetVersion) {
728+
return JVERSION;
729+
}
730+
731+
return $this->targetVersion;
732+
}
693733
}

0 commit comments

Comments
 (0)