Problem/Motivation
I have tested Slick together with the extensions Slick Views and Slick Extras under Drupal 9.3.2 and now I want to uninstall it. All sub modules except Slick itself can be uninstalled correctly via the Drupal web interface, only Slick itself cannot.
Steps to reproduce
When I try to uninstall Slick, I get the following error message:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "slick_filter" plugin does not exist. Valid plugin IDs for Drupal\filter\FilterPluginManager are: blazy_filter, editor_file_reference, filter_align, filter_autop, filter_caption, filter_html, filter_htmlcorrector, filter_html_escape, filter_html_image_secure, filter_null, filter_url, media_embed in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core\lib\Drupal\Component\Plugin\Discovery\DiscoveryTrait.php).
Drupal\Core\Plugin\DefaultPluginManager->getDefinition('slick_filter') (Line: 70)
Drupal\filter\FilterPluginCollection->initializePlugin('slick_filter') (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get('slick_filter') (Line: 26)
Drupal\filter\FilterPluginCollection->get('slick_filter') (Line: 92)
Drupal\filter\FilterPluginCollection->sortHelper('blazy_filter', 'slick_filter')
uasort(Array, Array) (Line: 90)
Drupal\Core\Plugin\DefaultLazyPluginCollection->sort() (Line: 84)
Drupal\filter\FilterPluginCollection->sort() (Line: 144)
Drupal\filter\Entity\FilterFormat->filters() (Line: 58)
Drupal\filter\FilterUninstallValidator->validate('blazy') (Line: 633)
Drupal\Core\Extension\ModuleInstaller->validateUninstall(Array) (Line: 99)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->validateUninstall(Array) (Line: 148)
Drupal\system\Form\ModulesUninstallForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 531)
Drupal\Core\Form\FormBuilder->retrieveForm('system_modules_uninstall', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
When uninstalling using drush pmu slick, you do not get any error message but the website is corrupted as well. You cannot perform any uninstallations using Drupal web interface after that. The above error message always appears.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 3257390-clean-uninstall-16.patch | 2.09 KB | gausarts |
| #14 | slick-2.jpg | 54.82 KB | crutch |
| #14 | slick-1.jpg | 74.24 KB | crutch |
Comments
Comment #2
gausarts commentedSimilar to Slick Views uninstallation issues if you have hidden Master display still keep Slick references.
Check out other issues here in case you have it as well.
Solutions in your case:
Since it is configurable and solved easily via UI, it is not a bug.
I had similar hard time with Markdown, and the above fixed it.
It is indeed annoying, unless someone steps in to offer better solutions, please accept the limitations :)
Comment #3
uwe_mue commentedSorry, which filters do you mean? There is no view that uses a slick format, nor is there any active slick filter in the Text Formats and Editors area. There are also no detectable references to slick in the Content Types or Media Types area.
Where else can I look?
Comment #4
gausarts commentedHmm, likely gone from UI but not exported files
Are you sure you never enabled Slick Filter? Verify this correctly.
Nevertheless, try:
grep slick_filter at your config export.
Or re-export.
Be sure to drush cr 3 times if stubborn :)
Comment #5
gausarts commented> There is no view that uses a slick format, nor is there any active slick filter in the Text Formats and Editors area. There are also no detectable references to slick in the Content Types or Media Types area.
So you can access the site again, assumed you re-installed as suggested. But forgot on which text format you ever enabled Slick.
Then try re-saving each text formats, and ensure Slick Filter is disabled. If not, the database still keeps it.
Once done, uninstall it for good.
Let me know.
Comment #6
uwe_mue commentedThanks for the hints. That I had to reactivate Slick by means of drush en slick was already clear. Otherwise I would not have been able to perform the further tests. I had also done drush cr and recalling and saving all text formats several times. I have now additionally deleted the view cache under admin/structure/views/settings/advanced, then executed drush cr several times and then drush pmu slick. Now it worked.
Comment #7
uwe_mue commentedRejoiced too soon. Unfortunately, not a single text editor works now. Neither the Ck editor nor plain text. Exactly the same error message appears as above. I then restored a data backup to have the initial situation again. But also the attempt to activate the slick filters for all editor filters, to save, then to remove all slick filters, to save again, then to uninstall slick with drush pmu slick lead again and again to the same result as described above.
Comment #8
gausarts commentedHm, works then not works.
I said this anywhere, I have to repeat it for just in case helpful in your case as well:
When CLI fails, try the good old browsers.
Be sure to follow my comments above including reexport if you did, and re-save.
If still stubborn something still holds it. If you can't find it at codebase with grep alike, it is likely in database.
Also be sure to remove it from composer.lock in case it is there. And put it manually till resolved.
As the last resort till anyone have time to step in to help, simply keep it installed, and don't do anything else. It won't bite you if you don't touch it anywhere :)
Let me know.
Comment #9
gausarts commented> When CLI fails, try the good old browsers.
Uninstall via Drupal UI for now.
Comment #11
crutch commentedOne item I found is that "Slick media" option remains in Page Manager/Panels, even when "Slick media" format is deleted and a replacement is chosen.
Comment #12
wrd-oaitsd commentedI've run into this problem as well, on a whole bunch of sites where I've been replacing Slick with Splide. I've tried many things, including:
Importing a format while Slick is installed doesn't seem to have an effect; the next time I try to export it, it shows the dependency again. Importing it with Slick uninstalled fails with an error indicating that another format depends on Slick but that it isn't installed. Clearing cache three times between each step has no effect.
The filter is not enabled in either text format:
Example of an attempt to disable the module:
Comment #13
gausarts commentedBefore I released modules, the first things I did normally, not always, were (un)-install cycles, 20x+ at different phases to ensure I was not locked in.
Honestly, since released, never re-checked.
This made me think additional or late features like Slick Filter, etc., remember they were added years after releases, obviously got away from initial screening.
Noted, thanks:
Slick Filter
Page manager
I will see if I can find references for their hook_uninstall. I did try searching samples at the entire Drupal codebase via grep last time, no joy, yet.
As I said above, I had the same issues with Markdown, and succeeded via UI with the details mentioned above. But I understand, it might be another case with Slick.
Patches are welcome if anyone beat me to it.
Sorry for inconveniences.
Thanks.
Comment #14
crutch commentedThanks for quick responses. Still working on this :)
I export full archive at /admin/config/development/configuration/full/export
Searched all for Slick.
First, was that I removed Slick from all filter formats, example: filter.format.MY_FORMAT.yml
------
dependencies:
module:
- blazy
- slick...
slick_filter:id: slick_filter
provider: slick
status: false
weight: 4
settings:
optionset: default
media_switch: ''
------
Then, Import/Single Item/Text Format, for each format. End up with this during uninstall. Where as before the text formats where listed above.
Backup data
Attempt uninstall, flush cache, visit any page = website encountered error
Restore
Then, remove image style and view mode so end up with this during uninstall
slick.optionset.default.yml and slick.settings.yml still exist
Backup data
Attempt uninstall, flush cache, visit any page = website encountered error
Restore
Comment #15
gausarts commentedI just had a chance to uninstall a Slick. And indeed the new Slick Filter is the culprit.
Till we provide a patch, you can copy below code into any theme function like preprocess_page, etc. for immediate remedy.
Reload page. Wait till finish. And delete the lines:
It appears Blazy has no issues when being uninstalled with its Blazy Filter. Not sure about Splide.
The error pages affected after uninstall:
You can still access the rest of admin and front pages, including Performance (clearing cache) pages.
UPDATED with cleanest version.
Comment #16
gausarts commentedAttached should clean out the unclean
slickandslick_filterreferences.Comment #18
gausarts commentedUnlike of core filter.module, Slick is not aware of Page Manager.
IMHO it is not a module business for something it is not aware of in the first place.
Technically, the blocker of uninstallation was removed with this patch, the rest (Page Manager, etc.) should not be blocked anymore.
If however such assumption were proven wrong, feel free to re-open.
Be sure to provide the similar helpful error messages to avoid blind guesses.
We got a new hot fix to release this weekend.
Committed. Thank you all for contribution.
Comment #19
wrd-oaitsd commentedI am indeed able to uninstall the module after applying the patch. Thank you!
Comment #20
crutch commentedJust able to get back to this today. Thanks for updates! Composer is complaining for me with patch
- Installing drupal/slick (2.5.0): Extracting archive
- Applying patches for drupal/slick
https://www.drupal.org/files/issues/2022-02-11/3257390-clean-uninstall-1... (3257390: It is not possible to uninstall slick)
Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2022-02-11/3257390-clean-uninstall-1...
Comment #21
gausarts commentedHm, not sure about the failing patch, can be many reasons. Most obvious is different code base from the expected patch.
Comment at #19 said OK.
Try requiring DEV, or revert to the previous branches, including Blazy, till the next hot fix release.
Let me know.
Comment #22
crutch commentedThank you for quick replies :) Since patch is committed to 2.x-dev I used that version and can confirm uninstall now works. Again thank you for your help with this!
Type system
Date Thursday, February 17, 2022 - 09:30
User admin
Location http://localhost/*/web/admin/modules/uninstall/confirm
Referrer http://localhost/*/web/admin/modules/uninstall/confirm
Message slick module uninstalled.
Severity Info
Hostname 127.0.0.1
Comment #23
gausarts commentedOk, no worries, glad you did it :)
Thanks for confirming.
That will surely help convince others on the same boat :)