diff --git a/administrator/components/com_joomlaupdate/controllers/update.php b/administrator/components/com_joomlaupdate/controllers/update.php
index 8682cf07cfdb4..3b04f6c5cec84 100644
--- a/administrator/components/com_joomlaupdate/controllers/update.php
+++ b/administrator/components/com_joomlaupdate/controllers/update.php
@@ -102,6 +102,7 @@ public function download()
public function install()
{
$this->checkToken('get');
+ JFactory::getApplication()->setUserState('com_joomlaupdate.oldversion', JVERSION);
$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
$options['text_file'] = 'joomla_update.php';
diff --git a/administrator/components/com_joomlaupdate/models/default.php b/administrator/components/com_joomlaupdate/models/default.php
index 032617384d8ae..8f8ec4037fe71 100644
--- a/administrator/components/com_joomlaupdate/models/default.php
+++ b/administrator/components/com_joomlaupdate/models/default.php
@@ -922,9 +922,11 @@ public function cleanUp()
// Unset the update filename from the session.
JFactory::getApplication()->setUserState('com_joomlaupdate.file', null);
+ $oldVersion = JFactory::getApplication()->getUserState('com_joomlaupdate.oldversion');
// Trigger event after joomla update.
- JFactory::getApplication()->triggerEvent('onJoomlaAfterUpdate');
+ JFactory::getApplication()->triggerEvent('onJoomlaAfterUpdate', array($oldVersion));
+ JFactory::getApplication()->setUserState('com_joomlaupdate.oldversion', null);
}
/**
diff --git a/administrator/language/en-GB/en-GB.plg_actionlog_joomla.ini b/administrator/language/en-GB/en-GB.plg_actionlog_joomla.ini
index 07cde6ddcdbb9..27299f0c1b42d 100644
--- a/administrator/language/en-GB/en-GB.plg_actionlog_joomla.ini
+++ b/administrator/language/en-GB/en-GB.plg_actionlog_joomla.ini
@@ -46,7 +46,7 @@ PLG_ACTIONLOG_JOOMLA_USER_REGISTERED="User {username}{username} requested a username reminder for their account"
PLG_ACTIONLOG_JOOMLA_USER_RESET_COMPLETE="User {username} completed the password reset for their account"
PLG_ACTIONLOG_JOOMLA_USER_RESET_REQUEST="User {username} requested a password reset for their account"
-PLG_ACTIONLOG_JOOMLA_USER_UPDATE="User {username} updated Joomla to {version}"
+PLG_ACTIONLOG_JOOMLA_USER_UPDATE="User {username} updated Joomla from {oldversion} to {version}"
; Component
PLG_ACTIONLOG_JOOMLA_APPLICATION_CONFIG_UPDATED="User {username} changed settings of the application configuration"
PLG_ACTIONLOG_JOOMLA_COMPONENT_CONFIG_UPDATED="User {username} changed settings of the component {extension_name}"
diff --git a/plugins/actionlog/joomla/joomla.php b/plugins/actionlog/joomla/joomla.php
index c2ed2980e886e..de19216e09077 100644
--- a/plugins/actionlog/joomla/joomla.php
+++ b/plugins/actionlog/joomla/joomla.php
@@ -1049,14 +1049,22 @@ public function onAfterPurge($group = 'all')
*
* Method is called after user update the CMS.
*
+ * @param string $oldVersion The Joomla version before the update
+ *
* @return void
*
* @since 3.9.21
*/
- public function onJoomlaAfterUpdate()
+ public function onJoomlaAfterUpdate($oldVersion = null)
{
$context = $this->app->input->get('option');
$user = JFactory::getUser();
+
+ if (empty($oldVersion))
+ {
+ $oldVersion = JText::_('JLIB_UNKNOWN');
+ }
+
$message = array(
'action' => 'joomlaupdate',
'type' => 'PLG_ACTIONLOG_JOOMLA_TYPE_USER',
@@ -1067,6 +1075,7 @@ public function onJoomlaAfterUpdate()
'username' => $user->username,
'accountlink' => 'index.php?option=com_users&task=user.edit&id=' . $user->id,
'version' => JVERSION,
+ 'oldversion' => $oldVersion,
);
$this->addLog(array($message), 'PLG_ACTIONLOG_JOOMLA_USER_UPDATE', $context, $user->id);
}