missing_id

This commit is contained in:
NOrtmann1
2026-05-29 17:40:56 +01:00
parent 32cb8a9d9e
commit c785363384
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ include_once 'php/controller/showArticle-controller.php';
<form method="post" action="php/controller/updateArticle-controller.php" id="editor-form" class="article-editor-scope.editor-container article-editor-scope editor-container">
<main class="editor-main">
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "internal_error"): ?>
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "internal_error" || $_SESSION["message"] == "missing_id"): ?>
<p class="alert-message is-error">
Es ist ein Fehler beim Speichern aufgetreten. Bitte versuche es erneut.
</p>
@@ -5,6 +5,7 @@ require_once 'php/model/ArticleManager.php';
if (isset($_GET["id"])){
try {
$id = (int)$_GET["id"];
$articleManager = ArticleManager::getInstance();
$article = $articleManager->getArticle($_GET["id"]);
if($article != null){
+3 -1
View File
@@ -9,7 +9,9 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$_SESSION["message"] = "missing_parameters";
header("location: ../../index.php?pfad=updateArticle");
exit();
} else {
} elseif(!isset($id)) {
$_SESSION["message"] = "missing_id";
}else{
$newTitle = $_POST["title"];
$newContent = $_POST["content"];