diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 55119ef418d..5afea1d8bb3 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -287,13 +287,16 @@ if ($action == 'addcontainer') // and $urltograbdirrootwithoutslash is https://www.dolimed.com // Check pageurl is not already used - $tmpwebsitepage = new WebsitePage($db); - $result = $tmpwebsitepage->fetch(0, $object->id, $pageurl); - if ($result > 0) + if ($pageurl) { - setEventMessages($langs->trans("AliasPageAlreadyExists", $pageurl), null, 'errors'); - $error++; - $action='createcontainer'; + $tmpwebsitepage = new WebsitePage($db); + $result = $tmpwebsitepage->fetch(0, $object->id, $pageurl); + if ($result > 0) + { + setEventMessages($langs->trans("AliasPageAlreadyExists", $pageurl), null, 'errors'); + $error++; + $action='createcontainer'; + } } if (! $error) @@ -2003,7 +2006,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') print '