User tests: Successful: Unsuccessful:
Pull Request for Issue #40444 only the db schema part
alternative for #40461
added the same check as in index.php?option=com_installer&view=database
see #40444
Checks N/A
Schema is checked and Update is not able to proceed if there is a database structure issue
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
Category | ⇒ | Libraries |
Status | New | ⇒ | Pending |
@alikon P.S.: You can easily check that by installing a 3rd party extension which has update SQL scripts and then modify one of these scripts so it causes an error for that extension in the database checker. Your code here will report this as a schema error and block the update, the pre-update checker in the update component will not do that (as long as the schema check for the CMS core is ok).
Labels |
Added:
PR-4.3-dev
|
I have tested this item
I've successfully tested that this PR adds a check for database schema errors of the CMS to the cli updater which works the same way as the check for the database schema in the pre-update check of the Joomla Update component in the required settings part.
For testing I have added the following SQL to one of the core's update SQL scripts:
CREATE TABLE IF NOT EXISTS `#__foobar` (
`id` int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
And I have done the same but with a different table name with the update SQL script 4.0.0.sql of the patchtester.
Then I have patched the Version.php file so that an update was found, and then I have run the CLI core updater.
Result: The CLI updater reports the schema errors for the CMS but not for the Patchterster, and the update is refused.
Then I have fixed the database error for the core and run again the CLI updater.
Result: The update succeeded, the database schema errors of the Patchtester has been ignored like it should be.
I don't know if the way how the error messages are shown or some language strings need improvement. Maybe @brianteeman can have a look.
Labels |
Added:
bug
|
I have tested this item ✅ successfully on 9f07bb3
Tested on Joomla 4.3.4 @localhost PBF 2023
RTC
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-08-29 19:09:27 |
Closed_By | ⇒ | obuisard |
@alikon To me it seems that you are checking the database not only for the core but also for 3rd party extensions because you are using the complete changeset here: https://github.com/joomla/joomla-cms/pull/40468/files#diff-a88763fd45c8c476369964c9857883558ccbe56672b2304d651f9a583225cc20R418
But for the pre-update check only the core shall be checked. Therefore it filters for the extension if of the core (joomla files) and then uses only the first element of the changesets araay here:
joomla-cms/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
Lines 1306 to 1311 in c93bdfd
You have to do it in the same way.