When I tried to upgrade my mailsystem to 3.x (from 2.34), the upgrade ended up deleting hundreds of core and module files across my entire install.
This is because I have s3fs installed, and the call to file_build_uri('mailsystem') in the upgrade function ends up returning "s3://mailsystem" (a clear error), but then drupal_realpath converts that to an empty string, leaving class_dir as "/". Thus the sweep through ended up deleting every file with a class in my entire install. Gah!
Thankfully this was just a dev install, but what a nightmare. A simple check to make sure that drupal_realpath(file_build_uri('mailsystem')) doesn't return an empty string would remove the possibility of this disaster for future users.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | check_if_mailsystem_dir_exists.patch | 781 bytes | phma |
Comments
Comment #2
sgdev commentedIf this is so critical, why not create a patch for review?
Comment #3
phma commentedSame issue here. It's quite destructive if it can't find the mailsystem directory locally. I've attached a patch which prevents this from happening.
Comment #5
berdirmakes sense, thanks.