diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php
index ae29dab196b..19f72486c3f 100644
--- a/htdocs/websites/index.php
+++ b/htdocs/websites/index.php
@@ -137,6 +137,8 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
* Actions
*/
+if (GETPOST('refreshsite')) $pageid=0; // If we change the site, we reset the pageid.
+
// Add page
if ($action == 'add')
{
@@ -321,7 +323,7 @@ if ($action == 'updatemeta')
$res = $objectpage->fetch($pageid, $object->fk_website);
if ($res > 0)
{
- $objectpage->pageurl = GETPOST('WEBSITE_PAGENAME');
+ $objectpage->pageurl = GETPOST('WEBSITE_PAGENAME');
$objectpage->title = GETPOST('WEBSITE_TITLE');
$objectpage->description = GETPOST('WEBSITE_DESCRIPTION');
$objectpage->keywords = GETPOST('WEBSITE_KEYWORDS');
@@ -476,7 +478,7 @@ if (count($object->records) > 0)
}
$out.='';
print $out;
- print '';
+ print '';
if ($website)
{
@@ -529,22 +531,31 @@ if (count($object->records) > 0)
$out.='';
print $out;
- print '';
+ print '';
print '';
//print $form->selectarray('page', $array);