Why would anyone ever uninstall such an amazing module...

...but I guess we should still not throw any errors. Just hit this locally when running drush pmu libraries -y:

The following extensions will be uninstalled: libraries
Do you really want to continue? (y/n): y
rmdir(/var/www/html/d8/sites/default/files/library-definitions): [warning]
Directory not empty FileSystem.php:256

So I guess we need to clear out the local library definitions before removing the directory.

Also (and this is theoretically a separate issue, but I guess it's worth bringing up) we should probably use the configured library definitions path instead of hardcoding it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler created an issue. See original summary.

gfcamilo’s picture

Assigned: Unassigned » gfcamilo
gfcamilo’s picture

Assigned: gfcamilo » Unassigned
Status: Active » Needs review
FileSize
523 bytes
tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Ooh, that's neat. Forgot this function existed. Thanks!!

  • rjacobs committed 5e7ea58 on 8.x-3.x authored by gfcamilo
    Issue #2836285 by gfcamilo, tstoeckler: Error when uninstalling...
rjacobs’s picture

Status: Reviewed & tested by the community » Fixed

Very cool. That definitely seems to get the job done. I went ahead and committed.

rjacobs’s picture

Also I see that this bit is potentially pending:

Also (and this is theoretically a separate issue, but I guess it's worth bringing up) we should probably use the configured library definitions path instead of hardcoding it.

I suppose having that hardcoded would be alright as long as it's matched to what's in the shipped config and libraries_install(). Perhaps we should only take responsibility to remove what we installed, not what was configured... though I suppose the local registry doesn't have any purpose without the module installed (unless it's set to something like a public://some/path URI and mixed with some other non-library files). Anyway, this could possibly be dealt with in an issues I just opened: #2841071: Add admin conf GUI. That issues could actually expose the conf in a way that might start affecting things like this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.