fix(member-events): confirm actions reliably and normalize duplicate titles

This commit is contained in:
Jürgen Mummert
2026-03-01 10:22:53 +01:00
parent ccf60a31e7
commit 3942569fb3
4 changed files with 44 additions and 6 deletions
@@ -65,7 +65,14 @@ class MemberEventsController extends AbstractFrontendModuleController
if ('toggle_published' === $action) {
$this->eventRepository->togglePublished($eventId);
} elseif ('duplicate' === $action) {
$this->eventRepository->duplicate($eventId);
$newEventId = $this->eventRepository->duplicate($eventId);
if ($newEventId > 0 && $editPage instanceof PageModel) {
return new RedirectResponse($this->generateContentUrl($editPage, [
'event' => (string) $newEventId,
'ref' => base64_encode($backUrl),
]));
}
} elseif ('delete' === $action) {
$this->eventRepository->delete($eventId);
}
+2 -1
View File
@@ -84,7 +84,8 @@ class EventRepository
unset($row['id']);
if (array_key_exists('title', $row)) {
$row['title'] = trim((string) $row['title'].' (Kopie)');
$normalizedTitle = html_entity_decode((string) $row['title'], ENT_QUOTES | ENT_HTML5, 'UTF-8');
$row['title'] = trim($normalizedTitle.' (Kopie)');
}
if (array_key_exists('alias', $row)) {