function hosting_subdirs_post_hosting_import_task in Hosting 7.4
Same name and namespace in other branches
- 7.3 subdirs/hosting_subdirs.module \hosting_subdirs_post_hosting_import_task()
Implements hook_post_hosting_import_task().
File
- subdirs/
hosting_subdirs.module, line 175 - Allow sites to be installed in subdirectories.
Code
function hosting_subdirs_post_hosting_import_task($task, $data) {
// This is only relevant to sites.
if ($task->ref_type != 'site') {
return;
}
// This is only relevant to sites using a subdir.
if (!_hosting_subdirs_is_a_subdir_site($task->ref)) {
return;
}
// After cloning a site, we lose our alias and redirection during the import
// task, since they are blank on the back-end at that point. So we preserve
// them here from the original cloned site node, and re-instate them when the
// node gets re-saved.
// @see hosting_subdirs_node_presave().
$task->ref->subdir_redirection = $task->ref->redirection;
$task->ref->subdir_aliases = $task->ref->aliases;
}