[4.0] [RFC] Add update SQL script for admin modules parameters#33370
Closed
richard67 wants to merge 2 commits intojoomla:4.0-devfrom
Closed
[4.0] [RFC] Add update SQL script for admin modules parameters#33370richard67 wants to merge 2 commits intojoomla:4.0-devfrom
richard67 wants to merge 2 commits intojoomla:4.0-devfrom
Conversation
This was referenced Apr 27, 2021
Member
Author
|
Closing in favour of #33375 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #33314 .
Summary of Changes
This pull request (PR) adds an update SQL script (one for each db type) to fix the bootstrap size and header tag parameters of those admin modules touched by PR #33045 when updating from 4.0 Beta 7 or a previous 4.0 Beta.
In opposite to past cases when we had to manipulate JSON parameters with update SQL scripts, this script here uses JSON functions.
The reason for this is that
REPLACEfor strings.The requirement for point 1. is achieved by including the condition
params LIKE '{%}'into theWHEREclause of the update statement before extracting the JSON values in subsequent conditions.Beside this, the
WHEREclause of the update statement is made as precise as necessary in order to update only the desired modules.Request For Comments
Unfortunately this PR can't be merged right now as the minimum version requirements of Joomla 4 for databases are lower than what is needed to support JSON functions.
=> Ping @wilsonge : One more reason to raise the version requirement for MySQL to 5.7 and for MariaDB to 10.2.3 in Joomla 4.
Testing Instructions
Requirements
This PR needs to be tested for all supported database types (MySQL, MariaDB and PostgreSQL). In case of MySQL or MariaDB, if you can use both the "MySQLi" and the "MySQL (PDO)" database driver, test with both.
All testers please report back which database and driver types you have tested so it can be properly recorded.
The PR cannot be tested with patchtester because it needs to test database updates. It has to be tested as described below with use of update packages or custom update URL's.
Have an installation of Joomla 4.0 Beta 7 or earlier (but not before Beta 4) with clean admin control panel modules, i.e. you haven't modified them, or make a new installation of 4.0 Beta 7 if you don't have that.
In Global Configuration, switch on "Debug System" and set "Error Reporting" to "Maximum" to be sure to get notice of any PHP or SQL errors.
Update to the latest 4.0 nightly build.
Check the admin control panel.
Result: See section "Actual result BEFORE applying this Pull Request" below. The modules look weird.
Using a tool like e.g. phpMyAdmin or phpPgAdmin (depending on your database type), export the content of table
#__modules(Replace#__by your table prefix).Update to the update package built by Drone for this PR.
Check again the admin control panel.
Result: See section "Expected result AFTER applying this Pull Request" below. The modules look as they should.
Export again the content of table
#__modulesinto a different file than the one used in step 5.Compare the file created in step 8 with the one created in step 5, and compare the differences you can see with the differences shown in PR [4.0] Admin modules bootstrap #33045 for the
base.sqlfile for your database type..Result:
#__moduleswhich have been modified in filebase.sqlwith PR [4.0] Admin modules bootstrap #33045 have also been modified when updating to the update package of this PR.#__moduleshave not been modified during the update.base.sqlfile in PR [4.0] Admin modules bootstrap #33045 .This can't be avoided when using JSON functions for the update.
But only the
bootstrap_sizeand theheader_tagproperties have been changed or have been added where missing in the same way as in thebase.sqlfile in PR [4.0] Admin modules bootstrap #33045 for new installations.All other properties remain unchanged.
Actual result BEFORE applying this Pull Request
See issue #33314.
After updating a Joomla 4.0 Beta 7 (or previous 4.0 Beta) to latest nightly build:
Expected result AFTER applying this Pull Request
After updating a Joomla 4.0 Beta 7 (or previous 4.0 Beta) to the update package built by drone for this PR, the admin dashboard looks the same as after a new installation of current 4.0-dev or latest nightly without this PR applied.
Documentation Changes Required
None.