Closed (fixed)
Project:
Deleted Modules
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Oct 2018 at 08:26 UTC
Updated:
27 Dec 2018 at 14:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tatarbjComment #3
tatarbjIt was quite complex to implement, but here we come!
The problem was with the original implementation of how the module collects the projects that are not correctly removed in _get_deleted_modules() as it overlooks the Drupal way that sets -1 in the schema_version when uninstallation happened on an extension (module/theme) - https://api.drupal.org/api/drupal/includes%21install.inc/constant/SCHEMA....
So I extended that query to check that parameter too, as after removing the files with drush_delete_dir() I was not able to remove the item from the database. Basically, the uninstall process only marks the module with this schema_version that will tell the garbage collector during a cache-clear process, it is safe to be totally removed.
When I tried to implement a classic cache-clear at the end of the whole dmc command, it has never done the expected behavior, most probably as we are not in the same bootstrap level or drush commands are simply atomic (?).
Anyway, when you execute the whole command now, answering the very last question a 'y', it will remove the folder with its content from the filesystem but as expected (I would say correct Drupal behavior ¯\_(ツ)_/¯ ) the module will remain in db with its -1 as schema_version - that will be removed after a simple drush cc all.
Qed :)
Bests,
Balazs.
Comment #4
tatarbjComment #5
manuel garcia commentedThanks @tatarbj for tackling this, awesome work so far!
Here is my review:
I don't think this is necessary :)
Nit: Lets get the path only if the user confirms it wants to delete it. Also, trailing whitespaces :)
Lets check if the deletion was successful and log accordingly:
Great find!
Comment #6
tatarbjNice review, thanks for it @Manuel!
Let me answer your points:
1. correct, I've removed it from the new patch.
2. trailing whitespaces are removed, but to ask the confirmation and I believe it's important for the user, we should present the path, so it should be asked before the confirm. Then I'm keeping the line there (without the trailing spaces :))
3. correct, I've changed it accordingly to your suggestion - nice improvement!
4. it took a while to realize why things were not working as expected :P I know it's quite an overplanning and not that much needed on d7 contribs, but I would say after the stable release, we should think about some test coverage for the module. Wouldn't you mind to create a feature request issue in the queue to remind us later for this with minor priority?
Bests,
Balazs.
Comment #8
manuel garcia commentedRe
#6.2 Ah you're right, I agree.
#6.4 I was thinking the same, opened #3020325: Automated tests for it.
Rerolled and fixed trailing spaces on commit.