wwarning suppression de page sans contenu

This commit is contained in:
fredtempez 2022-02-10 08:03:52 +01:00
parent 2a8a303de1
commit c0110c7c22
1 changed files with 3 additions and 1 deletions

View File

@ -360,7 +360,9 @@ class page extends common {
// Supprime l'ancienne page si l'id a changée
if($pageId !== $this->getUrl(2)) {
$this->deleteData(['page', $this->getUrl(2)]);
unlink (self::DATA_DIR . self::$i18n . '/content/' . $this->getUrl(2) . '.html');
if (file_exists(self::DATA_DIR . self::$i18n . '/content/' . $this->getUrl(2) . '.html')) {
unlink (self::DATA_DIR . self::$i18n . '/content/' . $this->getUrl(2) . '.html');
}
}
// Traitement des pages spéciales affectées dans la config :
if ($this->getUrl(2) === $this->getData(['locale', 'legalPageId']) ) {