Przeglądaj źródła

Fix erreur création document tags

stany.ferer 1 rok temu
rodzic
commit
62c1649894
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      core/views/pages/cms.document.php

+ 3 - 3
core/views/pages/cms.document.php

@@ -19,9 +19,9 @@ if (core::getGet("id") == NULL) {
     $submit = "Modifier ce document";
     $badgeCSS = " font-size:0.4em; margin-top:-5px;";
     $titre = "[#" . $document["id"] . "] " . $document["titre"];
-
-    $userTags = user::getUserById(session::getId())["tags"];
 }
+
+$userTags = user::getUserById(session::getId())["tags"];
 ?>
 <header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
     <h2 class="bd-title" id="content">
@@ -121,7 +121,7 @@ if(isset($document["id"]) AND tags::compareUserDocument($userTags, $document["ta
             </div>
             <br />
 
-            <?php if(tags::compareUserDocument($userTags, $document["tags"]) == TRUE){ 
+            <?php if(isset($document) AND tags::compareUserDocument($userTags, $document["tags"]) == TRUE){ 
                 $checkDone = (isset($document["id_user_done"])) ? " checked disabled" : NULL;
                 $checkText = (isset($document["id_user_done"])) ? "Ce document a été traité par ". $document["doneUser"] . " le " . $document["date_done"] : "Ce document a été traité";
             ?>