v1.6.12 — image de couverture modifiable en édition #80

Merged
cedricAbonnel merged 1 commits from dev into main 2026-05-15 21:09:46 +00:00
4 changed files with 23 additions and 4 deletions
Showing only changes of commit 88cc67d945 - Show all commits
+7
View File
@@ -5,6 +5,13 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) — versionnag
---
## [1.6.12] - 2026-05-15
### Ajouté
- Wizard édition — étape SEO : sélecteur d'**image de couverture** (og:image) désormais affiché en mode édition (était limité à la création) — sélection parmi les fichiers images existants, appliquée immédiatement via `setCover()` et mémorisée dans le draft overlay
---
## [1.6.11] - 2026-05-15
### Corrigé
+14 -2
View File
@@ -961,10 +961,17 @@ switch ($action) {
case 5:
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$articles->saveDraftOverlay($uuid, [
$overlayFields = [
'seo_title' => trim($_POST['seo_title'] ?? ''),
'seo_description' => trim($_POST['seo_description'] ?? ''),
]);
];
$coverFile = trim($_POST['cover_file'] ?? '');
if ($coverFile !== '' && $coverFile !== ($draft['cover'] ?? '')) {
$articles->setCover($uuid, $coverFile);
$updatedCover = $articles->getByUuid($uuid)['cover'] ?? $coverFile;
$overlayFields['og_image'] = rtrim(APP_URL, '/') . '/file?uuid=' . rawurlencode($uuid) . '&name=' . rawurlencode($updatedCover);
}
$articles->saveDraftOverlay($uuid, $overlayFields);
header('Location: /edit/' . rawurlencode($uuid) . '/6');
exit;
}
@@ -979,6 +986,8 @@ switch ($action) {
$published = (bool)($draft['published'] ?? false);
$published_at = $draft['published_at'] ?? '';
$category = $draft['category'] ?? '';
$existingFiles = $articles->getFiles($uuid);
$article = $draft;
include BASE_PATH . '/templates/wizard/step5.php';
break;
@@ -1014,6 +1023,9 @@ switch ($action) {
if ((bool)($draftData['published'] ?? false) !== (bool)($article['published'] ?? false)) {
$changes[] = ($draftData['published'] ?? false) ? 'article publié' : 'article dépublié';
}
if (($draftData['og_image'] ?? '') !== ($article['og_image'] ?? '')) {
$changes[] = 'image de couverture modifiée';
}
$autoRevisionComment = !empty($changes) ? ucfirst(implode(', ', $changes)) : '';
$title = $draftData['title'] ?? '';
$seoTitle = $draftData['seo_title'] ?? '';
+1 -1
View File
@@ -1 +1 @@
1.6.11
1.6.12
+1 -1
View File
@@ -98,7 +98,7 @@ $_catVal = trim($category ?? '');
</div>
</div>
<?php if ($mode === 'create' && !empty($existingFiles ?? [])): ?>
<?php if (!empty($existingFiles ?? [])): ?>
<?php $_imgFiles = array_filter($existingFiles, fn ($_f) => $_f['is_image']); ?>
<?php if ($_imgFiles): ?>
<div class="mb-0">