v1.6.11 — slug immuable en édition #79
@@ -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
|
## [1.6.10] - 2026-05-15
|
||||||
|
|
||||||
### Corrigé
|
### Corrigé
|
||||||
|
|||||||
+29
-6
@@ -89,16 +89,39 @@ Chemin serveur : `varlog:/var/www/lan.acegrp.varlog/`
|
|||||||
À utiliser uniquement si l'UpdateChecker échoue :
|
À utiliser uniquement si l'UpdateChecker échoue :
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Sauvegarde du .env
|
||||||
cp /var/www/lan.acegrp.abonnel-www/.env /tmp/.env.bak
|
cp /var/www/lan.acegrp.abonnel-www/.env /tmp/.env.bak
|
||||||
|
|
||||||
|
# Clone fresh (en root car /var/www appartient à root)
|
||||||
sudo rm -rf /var/www/lan.acegrp.abonnel-www
|
sudo rm -rf /var/www/lan.acegrp.abonnel-www
|
||||||
git clone --depth=1 https://git.abonnel.fr/cedricAbonnel/folio.git /var/www/lan.acegrp.abonnel-www
|
sudo git clone --depth=1 https://git.abonnel.fr/cedricAbonnel/folio.git /var/www/lan.acegrp.abonnel-www
|
||||||
cp /tmp/.env.bak /var/www/lan.acegrp.abonnel-www/.env
|
|
||||||
cd /var/www/lan.acegrp.abonnel-www && composer install --no-dev --optimize-autoloader
|
# Permissions : www-data propriétaire (PHP-FPM tourne en www-data)
|
||||||
php database/migrate.php
|
sudo chown -R www-data:www-data /var/www/lan.acegrp.abonnel-www
|
||||||
git -C /var/www/lan.acegrp.abonnel-www config user.email 'cedric@abonnel.fr'
|
sudo chmod -R g+rwX,o= /var/www/lan.acegrp.abonnel-www
|
||||||
git -C /var/www/lan.acegrp.abonnel-www config user.name 'Cédrix'
|
|
||||||
|
# Restauration du .env
|
||||||
|
sudo cp /tmp/.env.bak /var/www/lan.acegrp.abonnel-www/.env
|
||||||
|
sudo chown www-data:www-data /var/www/lan.acegrp.abonnel-www/.env
|
||||||
|
|
||||||
|
# Dépendances et migrations (en tant que www-data car le répertoire lui appartient)
|
||||||
|
cd /var/www/lan.acegrp.abonnel-www
|
||||||
|
sudo -u www-data composer install --no-dev --optimize-autoloader
|
||||||
|
sudo -u www-data php database/migrate.php
|
||||||
|
|
||||||
|
# Répertoire de sessions
|
||||||
|
sudo mkdir -p /var/www/lan.acegrp.abonnel-www/.sessions
|
||||||
|
sudo chown www-data:www-data /var/www/lan.acegrp.abonnel-www/.sessions
|
||||||
|
sudo chmod 700 /var/www/lan.acegrp.abonnel-www/.sessions
|
||||||
|
|
||||||
|
# Autoriser git à opérer sur ce dépôt (multi-utilisateurs)
|
||||||
|
sudo git config --system --add safe.directory /var/www/lan.acegrp.abonnel-www
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Règles à respecter
|
## Règles à respecter
|
||||||
|
|||||||
@@ -985,10 +985,6 @@ switch ($action) {
|
|||||||
case 6:
|
case 6:
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['_confirm'])) {
|
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['_confirm'])) {
|
||||||
$revisionComment = trim($_POST['revision_comment'] ?? '');
|
$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);
|
$articles->commitDraftOverlay($uuid, $revisionComment);
|
||||||
$final = $articles->getByUuid($uuid);
|
$final = $articles->getByUuid($uuid);
|
||||||
header('Location: /post/' . rawurlencode($final['slug'] ?? $uuid));
|
header('Location: /post/' . rawurlencode($final['slug'] ?? $uuid));
|
||||||
@@ -1001,7 +997,6 @@ switch ($action) {
|
|||||||
unset($_pd);
|
unset($_pd);
|
||||||
$diffLines = lineDiff((string)($article['content'] ?? ''), (string)($draftData['content'] ?? ''));
|
$diffLines = lineDiff((string)($article['content'] ?? ''), (string)($draftData['content'] ?? ''));
|
||||||
$titleChanged = ($draftData['title'] ?? '') !== ($article['title'] ?? '');
|
$titleChanged = ($draftData['title'] ?? '') !== ($article['title'] ?? '');
|
||||||
$autoSlug = slugify($draftData['title'] ?? '');
|
|
||||||
$postSlug = $draftData['slug'] ?? $article['slug'];
|
$postSlug = $draftData['slug'] ?? $article['slug'];
|
||||||
$changes = [];
|
$changes = [];
|
||||||
if ($titleChanged) {
|
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),
|
// Attendu (edit only) : $uuid, $step, $totalSteps, $mode='edit', $article (original),
|
||||||
// $draftData, $diffLines, $changes, $autoRevisionComment,
|
// $draftData, $diffLines, $changes, $autoRevisionComment,
|
||||||
// $seoTitle, $seoDescription, $autoSeoDesc, $title (draft), $postSlug,
|
// $seoTitle, $seoDescription, $autoSeoDesc, $title (draft), $postSlug,
|
||||||
// $titleChanged, $autoSlug, $published, $published_at, $category
|
// $titleChanged, $published, $published_at, $category
|
||||||
ob_start();
|
ob_start();
|
||||||
$_CONTEXT = 3;
|
$_CONTEXT = 3;
|
||||||
$_backUrl = '/edit/' . rawurlencode($uuid) . '/5';
|
$_backUrl = '/edit/' . rawurlencode($uuid) . '/5';
|
||||||
$_formAction = '/edit/' . rawurlencode($uuid) . '/6';
|
$_formAction = '/edit/' . rawurlencode($uuid) . '/6';
|
||||||
$_slugFinal = ($titleChanged && $autoSlug !== $postSlug) ? $autoSlug : $postSlug;
|
|
||||||
?>
|
?>
|
||||||
<?php include __DIR__ . '/nav.php'; ?>
|
<?php include __DIR__ . '/nav.php'; ?>
|
||||||
|
|
||||||
<!-- En-tête : titre + boutons à droite ─────────────────────────────────── -->
|
<!-- En-tête : titre + boutons à droite ─────────────────────────────────── -->
|
||||||
<form method="POST" action="<?= htmlspecialchars($_formAction) ?>">
|
<form method="POST" action="<?= htmlspecialchars($_formAction) ?>">
|
||||||
<input type="hidden" name="_confirm" value="1">
|
<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 class="d-flex align-items-start justify-content-between gap-3 mb-4 flex-wrap">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user