Skip to content

Commit

Permalink
[joomla#43505] On update use changelog from updates table but fallbac…
Browse files Browse the repository at this point in the history
…k to extension table

Signed-off-by: Roland Dalmulder <[email protected]>
  • Loading branch information
roland-d committed Dec 16, 2024
1 parent 00a1a52 commit aaefeb7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ public function loadChangelog($eid, $source)
)
)
->select($db->quoteName('updates.version', 'updateVersion'))
->select($db->quoteName('updates.changelogurl', 'updateChangelogurl'))
->from($db->quoteName('#__extensions', 'extensions'))
->join(
'LEFT',
Expand All @@ -423,13 +424,17 @@ public function loadChangelog($eid, $source)
$this->translate($extensions);
$extension = array_shift($extensions);

if (!$extension->changelogurl) {
if ($source === 'manage' && !$extension->changelogurl) {
return '';
}

if ($source === 'update' && !$extension->updateChangelogurl && !$extension->changelogurl) {
return '';
}

$changelog = new Changelog();
$changelog->setVersion($source === 'manage' ? $extension->version : $extension->updateVersion);
$changelog->loadFromXml($extension->changelogurl);
$changelog->loadFromXml($source === 'manage' ? $extension->changelogurl : ($extension->updateChangelogurl ?: $extension->changelogurl));

// Read all the entries
$entries = [
Expand Down

0 comments on commit aaefeb7

Please sign in to comment.