[5.0] Insert new tasks with created_by user on new installations #41581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue # .
Summary of Changes
With pull requests #40788 , #40519 and #41326 , an insert statements for new scheduler tasks has been added to files "installation/sql/
<dbtype>
/extensions.sql".When I helped to finalize these PRs I decided to do this insert statement without specifying the "created_by" user ID because I was not sure if that would be converted to the real super user ID at the end of the installation.
Now I have checked and know that this would already be the case. See this line here and the method where it's in: https://github.com/joomla/joomla-cms/blob/5.0-dev/installation/src/Model/ConfigurationModel.php#L281 .
This pull request (PR) here adds the "created_by" user ID = 42 to the insert statement like we already do it elsewhere, see e.g. here: https://github.com/joomla/joomla-cms/blob/5.0-dev/installation/sql/mysql/base.sql#L792-L793
We do that because it will not be replaced by the right user ID when the value is zero, see here: https://github.com/joomla/joomla-cms/blob/5.0-dev/installation/src/Model/ConfigurationModel.php#L291 .
Testing Instructions
Code review, or make a new installation and check that the 3 new tasks show the right created by user,
Actual result BEFORE applying this Pull Request
The created_by user ID is zero for the new tasks and will be set to the super user when editing the task.
Expected result AFTER applying this Pull Request
The created by user ID is 42 in the SQL statement, and after the installation the created_by user is the super user used for the installation.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed