-
Notifications
You must be signed in to change notification settings - Fork 96
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
Make LeftAndMain independent of the presence of Versioned module #1050
base: 1
Are you sure you want to change the base?
Conversation
LeftAndMain's init() method calls two Versioned methods and this makes it impossible to have the Silverstripe-admin module installed without the Versioned module. In other parts of the Silverstripe-admin code we have the verification of the presence or absence of the Versioned class, instead in the init() method it is missing. Please, could you also introduce in the init() method the verification of the presence of the Versioned module in order to install the administrative panel without the Versioned module? Like in the file commit, for example.
p.s: I think that it is better to keep the Versioned module dependece in the composer.json. If someone wants to delete the Versioned module from their installation of the Silverstripe-admin, it could be put in the documentation that can be deleted by placing
in the root project composer.json |
indentation correction for travis
The versioned module in a requirement of the admin module Removing the versioned module via There are various other places in the within the admin module that reference the Versioned class, without first testing to see if that Versioned module exists, because it's always assume that it does We'll close this pull-request now. Feel free to open a new pull-request for anything else you think could be fixed or improved. |
Hi, have you read here? "LeftAndMain's init() method calls two Versioned methods and this makes it impossible to have the Silverstripe-admin module installed without the Versioned module. In other parts of the Silverstripe-admin code we have the verification of the presence or absence of the Versioned class, instead in the init() method it is missing." I think that it's possible to have the SilverStripe Admin module without the Versioned module. Only this modification is needed: https://github.com/silverstripe/silverstripe-admin/pull/1050/files The panel Admin modul should be independent. To add versioning support in SilverStripe Admin this module should be installed https://github.com/silverstripe/silverstripe-versioned-admin |
Versioned in a few different places throughout the admin module
These are also not wrapped in class_exists() We could in theory wrap everything in class_exists(), however then we'd run into the issue where versioned is already in composer.json, and removing it would be breaking change as far as semver is concerned. Therefore such a change would would need to happen in Silverstripe 5. Given that the versioned module is a requirement in composer.json, I hope this clarifies things |
For clarification: Adding and removing dependencies is not a semver issue; semver is about a guarantee of our APIs, not our dependencies. If someone is using admin and they themselves need versioned it should be in their However, trying to decouple |
@dhensby ok, but my commit does not break anything, but it would give the possibility, for those who needs, to install the SilverStripe Admin module without the Versioned module, simply adding I emphasize that in other parts of SilverStripe Admin the presence of the Versioned module is verified with the method has_extension(), less than in the Init() method of the LeftAndMain.php file. This really doesn't make sense. |
as @emteknetnz has pointed out, this is an incomplete implementation as edit: Ah, sorry, those other parts do check for the presence of versioned - ok. Well, then this should probably be reopened. |
LeftAndMain's init() method calls two Versioned methods and this makes it impossible to have the Silverstripe-admin module installed without the Versioned module.
In other parts of the Silverstripe-admin code we have the verification of the presence or absence of the Versioned class, instead in the init() method it is missing.
Please, could you also introduce in the init() method the verification of the presence of the Versioned module in order to install the administrative panel without the Versioned module?
Like in the file commit, for example.