fix : slug immuable en édition — suppression de la propagation auto (v1.6.11)
En mode édition, le slug ne doit jamais changer. Suppression du hidden[slug] dans step6.php et du bloc qui le sauvegardait dans le draft overlay avant commitDraftOverlay(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,13 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) — versionnag
|
||||
|
||||
---
|
||||
|
||||
## [1.6.11] - 2026-05-15
|
||||
|
||||
### Corrigé
|
||||
- En mode édition, le slug de l'article n'est plus jamais modifié : suppression du `hidden[slug]` dans l'étape 6 de confirmation et du bloc qui le propagait dans le draft overlay
|
||||
|
||||
---
|
||||
|
||||
## [1.6.10] - 2026-05-15
|
||||
|
||||
### Corrigé
|
||||
|
||||
@@ -985,10 +985,6 @@ switch ($action) {
|
||||
case 6:
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['_confirm'])) {
|
||||
$revisionComment = trim($_POST['revision_comment'] ?? '');
|
||||
// Si le slug a été modifié dans le formulaire de confirmation, le propager
|
||||
if (!empty($_POST['slug'])) {
|
||||
$articles->saveDraftOverlay($uuid, ['slug' => trim($_POST['slug'])]);
|
||||
}
|
||||
$articles->commitDraftOverlay($uuid, $revisionComment);
|
||||
$final = $articles->getByUuid($uuid);
|
||||
header('Location: /post/' . rawurlencode($final['slug'] ?? $uuid));
|
||||
@@ -1001,7 +997,6 @@ switch ($action) {
|
||||
unset($_pd);
|
||||
$diffLines = lineDiff((string)($article['content'] ?? ''), (string)($draftData['content'] ?? ''));
|
||||
$titleChanged = ($draftData['title'] ?? '') !== ($article['title'] ?? '');
|
||||
$autoSlug = slugify($draftData['title'] ?? '');
|
||||
$postSlug = $draftData['slug'] ?? $article['slug'];
|
||||
$changes = [];
|
||||
if ($titleChanged) {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.6.10
|
||||
1.6.11
|
||||
|
||||
@@ -2,19 +2,17 @@
|
||||
// Attendu (edit only) : $uuid, $step, $totalSteps, $mode='edit', $article (original),
|
||||
// $draftData, $diffLines, $changes, $autoRevisionComment,
|
||||
// $seoTitle, $seoDescription, $autoSeoDesc, $title (draft), $postSlug,
|
||||
// $titleChanged, $autoSlug, $published, $published_at, $category
|
||||
// $titleChanged, $published, $published_at, $category
|
||||
ob_start();
|
||||
$_CONTEXT = 3;
|
||||
$_backUrl = '/edit/' . rawurlencode($uuid) . '/5';
|
||||
$_formAction = '/edit/' . rawurlencode($uuid) . '/6';
|
||||
$_slugFinal = ($titleChanged && $autoSlug !== $postSlug) ? $autoSlug : $postSlug;
|
||||
?>
|
||||
<?php include __DIR__ . '/nav.php'; ?>
|
||||
|
||||
<!-- En-tête : titre + boutons à droite ─────────────────────────────────── -->
|
||||
<form method="POST" action="<?= htmlspecialchars($_formAction) ?>">
|
||||
<input type="hidden" name="_confirm" value="1">
|
||||
<input type="hidden" name="slug" value="<?= htmlspecialchars($_slugFinal) ?>">
|
||||
|
||||
<div class="d-flex align-items-start justify-content-between gap-3 mb-4 flex-wrap">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user