Problem/Motivation
The current Slick skins are implemented using the old hook_hook_info which will be deprecated anytime: #2233261: Deprecate hook_hook_info groups, mark hook_hook_info() for deletion
Quoted from SlickSkinInterface, dated back to 1/16/16 here:
* The hook_hook_info() is deprecated, and no resolution by 1/16/16:
* #2233261: Deprecate hook_hook_info()
* Postponed till D9I could not make it a plugin for few reasons at that time: lacking of plugin system knowledge, lacking of time, and was hesitant to make use of plugins as obviously it will add more classes.
Proposed resolution
Use the plugin system, deprecate old hook, and remove it at slick:8.x-3.0 or slick:9.x-1.0 at the latest.
Old skins such as y/ours or Slick Example should still work for BC during depreciation till finally removed.
If any issue with the new feature, you can always revert to the stable branch 8.x-2.0, at least this branch has 0 bug report as of this writing. It was fully released to avoid lengthy development with more features, and can be used as a restore point if any issue is discovered with this new feature. Aside from the fact that hook_hook_info() is not officially deprecated, just yet.
During transition, a new option is provided which can be toggled at Slick UI:
- Disable deprecated skins
Depending on your needs. Leave it unchecked if things are broken, or (y/our) sub-modules are not updated with the new plugin system, yet. If you are sure things are not broken, or never register a skin nor using Slick examples, you can check this to reduce extra join. At any rate, skins are permanently cached once, so should not impact much.
Remaining tasks
Create a patch. Review. Tests.
This can be done anytime, no rushes.
User interface changes
None.
API changes
Yes, should be updated after commit:
https://git.drupalcode.org/project/slick/blob/8.x-2.x/slick.api.php#L341
| slick:7.x-3.0 - 8.x-2.0 (Before) | slick:8.x-2.1+ (After) |
|---|---|
To register a skin:
The class must implement |
To register a skin:
The SlickSkin object has 3 supported methods: The method bodies (the array structure of skin definitions) are similar to previous ones, no changes. |
Change records:
https://www.drupal.org/node/3105648
Data model changes
(Database or configuration data changes that would make stored data on an existing site incompatible with the site's updated codebase, including changes to hook_schema(), configuration schema or keys, or the expected format of stored data, etc.)
None.
Release notes snippet
(Major and critical issues should have a snippet that can be pulled into the release notes when a release is created that includes the fix)
Might be Major, but none of this change is critical, BC should be maintained.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 3105670-skins-as-plugins-11.patch | 47.83 KB | gausarts |
| #5 | 3105670-skins-as-plugins-5.patch | 47.31 KB | gausarts |
| #4 | 3105670-skins-as-plugins-3.patch | 46.26 KB | gausarts |
Comments
Comment #2
gausarts commentedComment #3
gausarts commentedAnytime has come. As I didn't test it locally, I would be very much assisted with some failures.
The following new files are added:
Also updated slick.api.php, and few more related files.
The relevant depreciation notices are provided.
I will get back to this tomorrow or so regardless test results. Reviews are very much welcome. Thanks!
Comment #4
gausarts commentedWrong file, sorry.
Comment #5
gausarts commentedFixed for coding standards.
Comment #6
gausarts commentedComment #7
gausarts commentedComment #8
gausarts commentedComment #9
gausarts commentedComment #10
gausarts commentedComment #11
gausarts commentedAdded
hook_updateto clear skins cache.Comment #12
gausarts commentedComment #14
gausarts commentedCommitted for wider feedback. Any improvement is very much welcome, and correction may follow as always. Thanks!