joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.73k stars 3.64k forks source link

[5.1] Bad message in User Action Log on Joomla update #42163

Open dautrich opened 11 months ago

dautrich commented 11 months ago

Steps to reproduce the issue

  1. Update a Joomla 4.3.4 installation to Joomla 4.4.0
  2. Look into the User Action Log

Expected result

There is a message "User xxx updated Joomla from 4.3.4 to 4.4.0"

Actual result

Before the correct message, an additional message is thrown: "User xxx updated Joomla from Unknown to 4.4.0"

grafik

System information (as much as possible)

Joomla 4.4.0 PHP 8.2.2 MySQL 8.0.33

Additional comments

brianteeman commented 11 months ago

Confirmed

image

dautrich commented 5 months ago

I have changed the title of the issue because it still applies to Joomla 5.1 as well as to the previous versions:

grafik

Fedik commented 3 months ago

This happens because the event onJoomlaAfterUpdate triggered twice in UpdateModel. First time without version https://github.com/joomla/joomla-cms/blob/a7bba710c3f4447301632f67d18645ebe3ae809a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php#L885 And then again but with version https://github.com/joomla/joomla-cms/blob/a7bba710c3f4447301632f67d18645ebe3ae809a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php#L912

And the action log store log for both.

The first trigger should be removed, however I am not sure what backward compatibility effect it can have on 3rd plugins.

It for ALL Joomla versions: 3.x, 4.x, 5.x

HLeithner commented 3 months ago

Hmm should be ok to remove the first one. Only the user state file is deleted before the second event is called, don't know if this is/should be used by 3rd party at all.