How to safely uninstall?

Created on 22 April 2024, 8 months ago
Updated 21 May 2024, 7 months ago

Hi there,

in Drupal 10, when I try to uninstall Views Natural Sort, it displays a warning that a large part of my views will be deleted in the process. Presumably, these are all the views that Views Natural Sort works with. But I don't want them deleted!

Is there a way to safely remove this module without wiping my views? Maybe I'm missing something is some menu somewhere that will allow me to do that?

Thanks

πŸ’¬ Support request
Status

Needs review

Version

2.0

Component

Documentation

Created by

πŸ‡¨πŸ‡ΏCzech Republic markus_cz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @markus_cz
  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    Hey there,
    Each of those views that are to be deleted likely rely on Views Natural Sort in one way or another, and if they don't, I can help with that.

    For the ones that DO have "sort Naturally" selected in a sort filter, change it to regular sort.

    If they are all regular sort, then this likely needs to be a bug report instead of just a support request. In that case, the easiest way is going to be with config export if you need it uninstalled immediately. Export all your configuration using `drush cex`. Then do a search replace for the word "natural" with the word "standard". Then search for and remove views_natural_sort in the dependencies sections and finally remove views_natural_sort from core.extension.yml. Reimport your configuration using `drush cim`.

    Make sure you do this on a development site first.

    Let me know about if it's only views that are sorted naturally.

  • Merge request !14Resolve #3442536 "How to safely" β†’ (Open) created by generalredneck
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 8 months ago
    8 pass
  • Status changed to Needs review 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    @markus_cz,

    can you try this MR? This SHOULD decouple the "natural" sort plugin from the normal string fields and add a new proto field. You should now be able to search for "naturally sorted" in the fields to find the ones that can be sorted naturally. So this breaks it up so that the options are no longer "ascending, descending, ascending Naturally, and descending naturally" but instead just "ascending and descending" always. This is the first step on a way to removing some headaches for me as a maintainer as well, but it's a pretty big usability change...

    All that to say though, that if you have any fields that are using the "natural" plugin by the scene and marked as just regular sort orders instead of their natural counter parts, this should switch the plugin over to the "standard" one and remove the dependency on the module, allowing you to uninstall this module.

  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    Rerolled this MR with the latest Dev release.

  • πŸ‡¨πŸ‡ΏCzech Republic markus_cz

    Hi generalredneck. Thanks for the quick reply, and sorry it took me so long to react. I've been to busy to care about my web till now. Anyway...

    I'm afraid I don't really understand your instructions – I'm a mere neophyte, hacking my way through Drupal. The issue I have with uninstalling this, though, is that I'm not actually using natural sorting anywhere. I installed the module some time ago but haven't used it (because it couldn't – at least at that time – sort tables). And yet, when I try to uninstall it now, it seems that a large part of my views depend on it.

    To show a simple example, this is a view that would get deleted if I uninstalled this:

    https://www.drupal.org/files/issues/2024-05-21/example-view.jpg β†’

    A very simple one, not much to see. There's just one sort filter, "ascending" (not "ascending naturally"). So I'm not sure what exactly I can turn off to get rid of the dependency on Views Natural Sort. Any ideas?

    However, the most recent update seems to have solved my reason for wanting to uninstall – Views Natural Sorts was throwing all sorts of error after updating to Drupal 10. That no longer seems to be the case, so I may end up keeping the module and trying if it works in tables now. :)

  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    Markuz_cz,
    Ok, so I have a feel for your level of experience. I don't know if you have ever "patched" a module before, but that's essentially what I'm asking you to do to test it out. Here are some instructions on how to do it both manually if you downloaded the module, or via composer if you are installing your modules that way. Given that, I would really expect you to do this on a copy of a website (not your production one) so that if anything goes wrong we can just trash it.

    So if you aren't "naturally sorting" anything (which in the case of the image you aren't for sure) then having this installed shouldn't hurt anything beyond being a draw on performance, but it does hook in to "entity save", so basically any time you save anything like configuration, content, blocks, etc.

    Lastly, I'm just pointing out that I think you have in fact pointed out a bug. I'm fairly certain I can reproduce it on a clean install of Drupal, but I need to do some more testing before I'm comfortable with releasing the fix. It's so wildly different that this may become a new 3.0 version.

Production build 0.71.5 2024