Commit 1ee65ab6 authored by anarcat's avatar anarcat Committed by Antoine Beaupre

#683800 - fix removal of symlink on site removal

this was failing because provision_path_unlink was checking the file existence (file_exists) before removing the symlink. in this case, the file really *didn't* exist because the link target was already removed.

instead of checking, we just try to delete the file, if it fails, it will return false anyways.

we do the same with rmdir while we're here.

also make sure we work on the trimmed file path
parent 03eb58c0
......@@ -397,7 +397,7 @@ function _provision_drupal_delete_aliases($aliases) {
$aliases = explode(",", $aliases);
}
foreach ($aliases as $alias) {
if (trim($alias)) {
if ($alias = trim($alias)) {
provision_path("unlink", drush_get_option('docroot_path') . "/sites/" . $alias, TRUE,
dt("Removed symlink for alias @alias", array("@alias" => $alias)),
dt("Could not remove symlink for alias @alias", array("@alias" => $alias)));
......
......@@ -146,11 +146,11 @@ function provision_path_mkdir($path) {
}
function provision_path_rmdir($path) {
return (file_exists($path) && is_dir($path)) ? rmdir($path) : false;
return rmdir($path);
}
function provision_path_unlink($path) {
return (file_exists($path)) ? unlink($path) : false;
return unlink($path);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment