User tests: Successful: Unsuccessful:
Pull Request for Issue #20500.
We are expecting the core extensions will always have the same ID. To achieve that we defined some ranges per plugin types, where every extension is getting a hardcoded ID during installation. This can bring us into troubles when we will exceed that range with core extensions. The current situation shows us that as when new extensions got added to 3 and 4, merging it from one branch to another leads to troubles. Especially when the privacy suite gets merged into 4. To prevent that we should get rid of the idea that core extensions will always have the same ID. More information can be found in issue #20500.
This pr removes the hardcoded ids from the installation script and removes traces in the code to hardcoded ID's. All core extensions do get installed in the order of the installations script and new extensions will follow. The increment index doesn't start anymore on 10'000.
All should work as before.
All is working.
We need to document that in the migration guide.
Status | New | ⇒ | Pending |
Category | ⇒ | SQL Administration com_admin Postgresql com_installer com_joomlaupdate com_postinstall Modules Installation Libraries Front End Plugins |
Labels |
Added:
?
?
|
You need to check the jaavascript as well. pretty certain that at least the update check uses the eid
You need the IDs in the joomla.sql
files because that file is seeding the initial database state which includes several pseudo-foreign key relations to the extensions table. So as long as our initial data seed is entirely a SQL file they need to exist there.
@brianteeman found it in the JS file, on it.
@mbabker I'v replaced the menu and update sites with subselects. So as far as I could see it there are no more hardcoded extension ids.
Category | SQL Administration com_admin Postgresql com_installer com_joomlaupdate com_postinstall Modules Installation Libraries Front End Plugins | ⇒ | SQL Administration com_admin Postgresql com_installer com_joomlaupdate com_postinstall Modules JavaScript Repository Installation Libraries |
I did a clean install of this branch
administrator/index.php?option=com_installer&view=update
gives
0 Class 'Joomla\Component\Installer\Administrator\Model\ExtensionHelper' not found
Does it include the latest two commits?
administrator/index.php?option=com_installer&view=updatesites
gives
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
administrator/index.php?option=com_joomlaupdate
gives
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Can you download it again as there was something missing in the update scripts. You need also to recompile the js files.
Can you download it again as there was something missing in the update scripts. You need also to recompile the js files.
no change
Strange, just tested it and it worked. What does the update_sites_extensions table has for content?
What does the update_sites_extensions table has for content?
That was the clue - it was missing the joomla update - rebuilt everything again etc and now those errors have gone
Can you mark as test successful then in the tracker? Thanks for testing!
Category | SQL Administration com_admin Postgresql com_installer com_joomlaupdate com_postinstall Modules Installation Libraries JavaScript Repository | ⇒ | SQL Administration com_admin Postgresql com_installer com_joomlaupdate com_languages com_postinstall com_users Modules JavaScript Repository Installation |
Category | SQL Administration com_admin Postgresql com_installer com_joomlaupdate com_postinstall Modules Installation JavaScript Repository com_languages com_users | ⇒ | SQL Administration com_admin Postgresql com_installer com_joomlaupdate com_postinstall Modules JavaScript Repository Installation Libraries |
I have tested this item
So we have two successful tests, setting to RTC.
Conflicts fixed
Then better to wait till privacy is merged? Because it takes me some time to clean up the merge conflicts, better to do it only once.
works for me
Labels |
Removed:
J4 Issue
|
Category | SQL Administration com_admin Postgresql com_installer com_joomlaupdate com_postinstall Modules Installation JavaScript Repository Libraries | ⇒ | SQL Administration com_admin Postgresql com_installer com_joomlaupdate com_postinstall Modules JavaScript Repository NPM Change Installation Libraries |
Labels |
Added:
NPM Resource Changed
|
Labels |
Removed:
NPM Resource Changed
|
Category | SQL Administration com_admin Postgresql com_installer com_joomlaupdate com_postinstall Modules Installation JavaScript Repository Libraries NPM Change | ⇒ | SQL Administration com_admin Postgresql |
Moved the plugins
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-04-17 10:03:04 |
Closed_By | ⇒ | wilsonge |
Thanks!
At your service :-)
@laoneo Maybe there is still something to be done.
The function getExtensionRecord
uses only the name as criteria to get the right extension record, and in several schema updates the element is used as the only criteria, e.g. WHERE element = 'phputf8'
. The first method would require that the name is unique for each extension, and the second method requires that the element is unique.
But in the extension table is no unique constraint for any of these columns name
or element
.
Is that by purpose, or is it just missing?
If just missing: Can we assume that there are never 2 core or 3rd party extensions using the same name, and can we assume the same for the element column? If so, it would just be enough to add unique constraints for those columns in the extension table. I would make a PR for that if desired.
But if it can't be granted that there will never be any extensions using the same name or element, then the criteria for getting the right extension should be extended, e.g. like it is for checking if core extension, where we have columns type
, element
, folder
and client_id
, and combination of these can be used to identify the extension, so the mathing criteria to get the 1 extension we want would be e.g. WHERE type = 'library' AND element = 'phputf8' AND folder = '' AND client_id = 0
in schema updates, and the getExtensionRecord
would be changed in the same way.
Or maybe a mix of both, e.g. the name column can be assumed to be unique, so we add a uniqoe constraint for it, but the element column can not be assumed to be unique, so we use the condition for columns type
, element
, folder
and client_id
mentioned above in the schema updates, or maybe vice versa, i.e. name column not unique, but element comun unique?
I could make a PR for any of the mentioned solutions, but I need feedback if something has to be done and what is the better way.
But like it is now it is not ok, too risky assuming something is unique and not having a unique constraint on it.
Maybe all that was discussed before, but I was missing the discussion because I did not have much time for Joomla in the recent months?
Update: I just see that neither the name nor the element is unique for extensions, like language packs for site and admin having same values for both. So we can't add unique constraints for these columns.
element and folder should be unique i think. Element is unique for everything except plugins. And in the case of plugins element combined with folder is unique.
@wilsonge The schema updates could be ok as long as no third party extensions use element values like 'phputf8' or so, but we could make them 100% safe by using type and element and folder and client_id as criteria. I could make a PR for that.
The name column is not unique. But the new getExtensionRecord
functions seems to check only loaded plugins, correct me if that is wrong. So for language extensions which use same name and same element for admin and site clients we could be safe with checking name only because never 2 clients site and admin are loaded at the same time, but I am not sure about 3rd party stuff.
The element determines what folder the app gets placed in. Even if the database doesn’t enforce it I think if you’ll find the existing phputf8 library would get overwritten
@alikon or @richard67, I did the postgres changes without testing. Can you guys please have a look if they are correct?