-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Fix broken check for com_admin in database schema fixer #30233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Fix broken check for com_admin in database schema fixer #30233
Conversation
|
I deleted a column in
But it's displayed for "Joomla CMS" extension (eid=208) where Surprisingly, clicking "Update Structure" helped even on the current beta3 code without patch applied (the column was re-created). |
Here it is extension ID 213, which has element = 'com_admin. Maybe the difference is due to your update history? I have used a brand nex installation of current 4.0-dev branch. But you can check it yourself by adding some debug output like in my instructions, extended a bit, e.g.
Well, that is how it shall work and is absolutely unrelated to this PR. The schema changes are done anway, with and without this PR. The only thing what the check for ' com_admin' is good for is to run additional utf8mb4 stuff for the core. |
|
@Denitz You are right, it's weird that in database, the extension record has |
|
Just corrected testing instructions, now they are ok. |
|
@Denitz If you add the |
|
@richard67 I performed clean beta3 installation and performed the same trick with column removal. eid is 213 and element is really 'joomla' but not Schemas are checked via #__schemas has a single record with extension_id = 213 which is But the load changeset really has element=com_admin even though extension_id is 213 which is not com_admin: It's because of model code which auto-replaces element from So, checking for element=com_admin is correct. And: the patch works. But: the utf8mb4 conversion is still executed if #__utf8_conversion table is found and the conversion will be never finished due to new #__history table. |
For fixing this you need my other PR #30227 . So please test both as described and then mark the test results on the issue tracker by using the "Test this" button, selecting the appropriate test result and then submitting. Issue tracker item for this PR: https://issues.joomla.org/tracker/joomla-cms/30233 Issue tracker item for the other PR: https://issues.joomla.org/tracker/joomla-cms/30227 Thanks in advance. |
|
I have tested this item ✅ successfully on ffd0ee2 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30233. |
1 similar comment
|
I have tested this item ✅ successfully on ffd0ee2 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30233. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30233. |
|
Thanks guys for testing. |
Pull Request for Issue #30223 .
Summary of Changes
This pull request (PR) fixes an error from PR #17537 which has introduced database schema checker and fixer for extensions in Joomla 4.
The double error is that an arry index and not the value of an array which holds extension IDs is compared with the extension element value 'com_admin'.
This PR fixes it by using the
elementproperty of theextensionselement of the previously obtainedchangesetfor the given extension ID.Testing Instructions
Preparation
Have a clean, current 4.0-dev branch or a 4.0 nightly or a Beta 3 with at least one extension installed, e.g. the patchtester.
Have error reporting set to "Maximum" in Global Configuration in server settings.
In your PHP settings, have display errors on or log errors on and log into a file.
Procedure
Open file
administrator/components/com_installer/src/Model/DatabaseModel.phpin an editor and go to following line:https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_installer/src/Model/DatabaseModel.php#L264.
Before that line, add a line with debug output into the PHP log as follows:
error_log('Hello, I am com_admin');or whatever else comes into your mind, so it finally looks like:
Go to "System -> Information -> Database".
Use the "Update Structure" button with each of the following combinations of selected check boxes and then check your PHP error log if there is the debug log you have added before with the preparation for the test.
a) Only some extension's check box selected, but not the one for "Joomla CMS" = the core.
b Only "Joomla CMS" = the core's check box selected, but not any other check box for any extension.
c) The check box for "Joomla CMS" and also one of some extension selected.
Result: See section "Actual result BEFORE applying this Pull Request" below.
Apply the patch of this PR.
Note: When using patchtester you might have to remove the debug log which you have added before in step 2, then apply the patch and after that add back the debug log, so it looks like:
Result: See section "Expected result AFTER applying this Pull Request" below.
Actual result BEFORE applying this Pull Request
In all 3 cases a) to c) no debug log.
Expected result AFTER applying this Pull Request
a) Only some extension's check box selected, but not the one for "Joomla CMS" = the core => No debug log.
b Only "Joomla CMS" = the core's check box selected, but not any other check box for any extension => Debug log.
c) The check box for "Joomla CMS" and also one of some extension selected => Debug log.
Documentation Changes Required
None.