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.

CommentFileSizeAuthor
#3 check_if_mailsystem_dir_exists.patch781 bytesphma

Comments

skulegirl created an issue. See original summary.

sgdev’s picture

Version: 7.x-3.0-alpha1 » 7.x-3.x-dev

If this is so critical, why not create a patch for review?

phma’s picture

StatusFileSize
new781 bytes

Same 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.

  • Berdir committed 47cc3c0 on 7.x-3.x authored by phox4ever
    Issue #2700547 by phox4ever: Need to sanity test mailsystem directory in...
berdir’s picture

Status: Active » Fixed

makes sense, thanks.

Status: Fixed » Closed (fixed)

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