Fix generation of tpl

This commit is contained in:
Laurent Destailleur 2018-09-10 23:37:51 +02:00
parent a4a4b8ddff
commit 016bc6851b
2 changed files with 2 additions and 2 deletions

View File

@ -614,7 +614,7 @@ function dolSavePageContent($filetpl, $object, $objectpage)
$tplcontent.= '<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 0, 'UTF-8').'" />'."\n";
$tplcontent.= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.' (https://www.dolibarr.org)" />'."\n";
$tplcontent.= '<!-- Include link to CSS file -->'."\n";
$tplcontent.= '<link rel="stylesheet" href="styles.css.php?websiteid='.$object->id.'" type="text/css" />'."\n";
$tplcontent.= '<link rel="stylesheet" href="styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
$tplcontent.= '<!-- Include HTML header from common file -->'."\n";
$tplcontent.= '<?php print preg_replace(\'/<\/?html>/ims\', \'\', file_get_contents(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")); ?>'."\n";
$tplcontent.= '<!-- Include HTML header from page header block -->'."\n";

View File

@ -85,7 +85,7 @@ if (empty($pageid))
$objectpage=new WebsitePage($db);
$array=$objectpage->fetchAll($object->id);
if (count($array) > 0)
if (is_array($array) && count($array) > 0)
{
$firstrep=reset($array);
$pageid=$firstrep->id;