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
Add locked field to extensions table (and use it in core extensions) #13037
Conversation
@mbabker @richard67 @ggppdk @brianteeman @alikon @infograf768 would appreciate your opinions here. |
also @alikon can you please check postgresql and sqlsrv sql staments to make sure they are ok? |
@andrepereiradasilva It looks very good from my opinion, assuming it works as described and from a short look on the code changes. Unfortunately I have no time to test. |
Personally, I'm not a fan of introducing a data point to differentiate between a "core" extension and third party. I honestly feel like if we need this level of distinction then we're messing something else up somewhere. |
IMHO a user should not be able to uninstall core extensions, if you can uninstall it, it should not be a core extensions, but a core supported extension. So with this PR we can know which are the core exxtensions so we avoid them from being uninstalled... i honestly, as it is, don't see another way to check witch extensions are core extensions. |
If an extension should not be uninstallable, it should be protected. A design flaw in our system also means it cannot be disabled. Adding an additional column to track this state IMO is unnecessary. We should not need to know nor care about what the core extensions are in the database.
Considering PLT basically gave up on decoupling, at this point we should really just put weblinks back into core and we don't need to worry about making this distinction then. We can just protect everything then fix the design flaws that make protected extensions locked in an active state. Which is if I'm not mistaken entirely UI driven; the extension manager forcibly displays an inactive lock icon over protected extensions but if you go to the plugin manager you can freely enable/disable protected plugins (look at CodeMirror). So to me that indicates that the concept of a protected extension is already inconsistent in our interface and that just because an extension is protected does not mean it cannot be safely disabled. |
The other thing. There should be a difference between protected as in install/uninstall and protected as in state. A "core" column does not either any of those. In theory, anyone should be able to use any column in any of our database tables for their extensions. So if someone wants to create a package extension, install all of the package's extensions, set their state to protected, and change that state when uninstalling the package (there's a very crude workaround for the "user is able to install a package then separately uninstall its extensions" issue 😉) there should be nothing stopping them. |
If the objective is to be able to remove unused core extensions from the
admin menu then the problem is the hard coded nature of the current admin
menu and this can be easily resolved, as I have said for years, with a
proper menu manager for the admin. Something that thankfully we are very
close to.
|
@brianteeman on it's way: #13036 |
@@ -129,15 +129,13 @@ WHERE (`type` = 'component' AND `element` IN ( | |||
'com_ajax', | |||
'com_postinstall' | |||
)) | |||
OR (`type` = 'module' AND `element` IN ('mod_login', 'mod_menu', 'mod_quickicon', 'mod_toolbar')) | |||
OR (`type` = 'module' AND `element` = 1 AND `element` IN ('mod_login', 'mod_menu', 'mod_quickicon', 'mod_toolbar')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong element is never 1 ;) i guess it is meant to be client_id?
already corrected that |
My tests show here with a new install containing this PR + #13040 that one cannot uninstall anything core. Is it what is desired? |
Yes. It blocks a user from uninstalling the core extensions (which end up back on the filesystem anyway during upgrades) in part to prevent possible SQL errors during the upgrade when a component has been removed. |
so the number of extensions that is need to be protected is reduced again
I have doubt reggarding if those plugins need always to be enabled. authentication: joomla and user joomla in particular. |
fixed conflicts and now the number of extensions that is need to be protected is reduced again Locked Extensions (cannot be uninstalled by the user)All core extensions. Protected Extensions (cannot be enabled/disabled by the user)
Please test. |
If this is something that's going to get seen through then it needs a new owner. |
If this PR get no Response, it will be closed at 23th July 2017. |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/13037 |
closed as stated above. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13037. |
Summary of Changes
This adds a new column to extensions table named
locked
.This column is a flag 1 or 0 to check if extension can be uninstalled.
This PR also marks all core extensions as uninstallable (ie locked), but most are unprotected now so they can be disabled.
Testing Instructions
First do a code review.
Two test needed: update, install
Update
Install
This needs to be tested in all 3 db systems.
Documentation Changes Required
None.