Commit 72046685 authored by mig5's avatar mig5 Committed by mig5

handle checking of aliases in the clone form, and except on any alias that is...

handle checking of aliases in the clone form, and except on any alias that is already in use (unlike migrate, in which the site node is allowed to retain its current aliases)
parent aebd7b97
...@@ -28,6 +28,20 @@ function hosting_task_clone_form_validate($form, &$form_state) { ...@@ -28,6 +28,20 @@ function hosting_task_clone_form_validate($form, &$form_state) {
else { else {
hosting_task_migrate_form_validate($form, $form_state); hosting_task_migrate_form_validate($form, $form_state);
} }
// Although the following is more or less the same in the hosting_task_migrate_form_validate(),
// it's repeated here but the difference is we check if the alias is already in use *anywhere*,
// rather than make an exception for the current site node (which is allowed to retain its aliases)
if ($form_state['values']['parameters']['aliases']) {
$aliases = explode("\n", $form_state['values']['parameters']['aliases']);
foreach ($aliases as $alias) {
if ($alias = trim($alias)) {
if (!hosting_domain_allowed($alias)) {
form_set_error('aliases', t('The domain name @alias is already in use', array('@alias' => $alias)));
}
}
}
}
} }
function hosting_clone_theme($existing, $type, $theme, $path) { function hosting_clone_theme($existing, $type, $theme, $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