User tests: Successful: Unsuccessful:
Pull Request for Issue # .
Installing sample data during the installation of Joomla assigns the user's id with a random number not the super user's id. And this warning shows up after installation.
I made a query to fetch the user id where name = "Super User".
Status | New | ⇒ | Pending |
Category | ⇒ | Installation |
Labels |
Added:
?
|
Title |
|
Title |
|
This is honestly the wrong approach. If you follow the getUserId
call you'll find that the user ID should only be re-generated if the user ID is not present in the session. So if it's not there when sample data is being installed, THAT is your bug and that needs to be addressed; there should not be a need to re-query the super user ID in this manner.
This is honestly the wrong approach. If you follow the
getUserId
call you'll find that the user ID should only be re-generated if the user ID is not present in the session. So if it's not there when sample data is being installed, THAT is your bug and that needs to be addressed; there should not be a need to re-query the super user ID in this manner.
@mbabker
I thought of that too, and the solution would be removing install sample data during installation and make it after the user is logged in.
or once the user creates a joomla site, he is logged in.
This will not work for custom distributions from language communities where the name of the Super User is in their language.
Therefore I rather suggest to use a similar code as found in:
https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/sampledata/multilang/multilang.php#L1326-L1368
@infograf768 I will give it a look
hmm, after some thought, it seems that the issue we have with session not being forwarded further is the real issue.
I had remarked that when I found out that the chosen installed language is lost at some time during Joomla installation.
Just an idea: Could we add a user "sample data owner" (registered) when sample data are installed and use the ID of this user. It has the advantage that sample data later are easy to find and remove.
Just an idea: Could we add a user "sample data owner" (registered) when sample data are installed and use the ID of this user. It has the advantage that sample data later are easy to find and remove.
Actually, the whole sample data should be removed from the installation in 4.0.
There is no point in having the sample data module when we still maintain the sample data SQL files.
Beat me to it. I thought that decision had already been made - just the sql hasnt been removed yet
It is approved to remove it in the installer - just needs removing (BUT with the exception that the ability to use a custom sql file for template clubs is left in - because it's been made clear by many smaller template clubs they don't feel comfortable with the php api) - probably a different named file that similar to https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/src/Model/DatabaseModel.php#L676
Does it even need to be a different named file? Template clubs could use the exact same file as localised packs use. Or do the template clubs base their pack on localised ones?
Does it even need to be a different named file? Template clubs could use the exact same file as localised packs use. Or do the template clubs base their pack on localised ones?
I have no clue. But I don't want to find out the hard way and it's 8 lines to add a second if statement which seems like a small price to pay
I have tested this item
I can not understand the mistake. When I try to install sample data, the author is set correctly. Probably because I was logged in as an admin. Maybe this PR can be closed?
Meanwhile you can chose the user name of the super user at installation, so selecting by user name = "Super User" like this PR here does is definitely wrong.
@Schmidie64 The PR was about installing sample data during installation, not after installation.
Sample data installation shall be removed from the installation process, as far as I know, if that has not been done yet, and for after installation I see no issue.
Also I see no issue in the updateUserIds routine like it is now without this PR: After installation any user ids in database are set to the right value (if nothing was forgotten in that routine, which one of my recent PR's corrected for the workflows table).
So I think this PR is just wrong.
The data should be in the session. If it’s not we’ve got another bug somewhere. We’ve removed sample data after install. So going to close
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-10 11:42:35 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
This will not work for custom distributions from language communities where the name of the Super User is in their language.

Therefore I rather suggest to use a similar code as found in:
https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/sampledata/multilang/multilang.php#L1326-L1368