From 4261350d1c0206a4abcd6258412d2656178af6e1 Mon Sep 17 00:00:00 2001
From: Daniel Hoffmann <daniel.hoffmann@in2code.de>
Date: Tue, 12 Nov 2024 09:58:35 +0100
Subject: [PATCH 1/8] [FEATURE] Add event for editing module template

Relates: https://projekte.in2code.de/issues/67976
---
 .../Traits/ControllerModuleTemplate.php       | 12 ++++
 .../ModuleTemplateWasPreparedForRendering.php | 65 +++++++++++++++++++
 .../ModuleTemplateWasPreparedForRendering.md  | 38 +++++++++++
 3 files changed, 115 insertions(+)
 create mode 100644 Classes/Event/ModuleTemplateWasPreparedForRendering.php
 create mode 100644 Documentation/Developers/Events/ModuleTemplateWasPreparedForRendering.md

diff --git a/Classes/Controller/Traits/ControllerModuleTemplate.php b/Classes/Controller/Traits/ControllerModuleTemplate.php
index 8e974e663..1479f2d54 100644
--- a/Classes/Controller/Traits/ControllerModuleTemplate.php
+++ b/Classes/Controller/Traits/ControllerModuleTemplate.php
@@ -31,6 +31,8 @@
 
 use In2code\In2publishCore\Backend\Button\ModuleShortcutButton;
 use In2code\In2publishCore\CommonInjection\ModuleTemplateFactoryInjection;
+use In2code\In2publishCore\Event\ModuleTemplateWasPreparedForRendering;
+use Psr\EventDispatcher\EventDispatcherInterface;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
@@ -43,6 +45,8 @@
 
 /**
  * @property Request $request
+ * @property EventDispatcherInterface $eventDispatcher
+ * @property string $actionMethodName
  */
 trait ControllerModuleTemplate
 {
@@ -84,6 +88,14 @@ protected function render(): string
         $buttonBar->addButton($moduleShortcutButton);
 
         $this->moduleTemplate->setContent($this->view->render());
+
+        $event = new ModuleTemplateWasPreparedForRendering(
+            $this->moduleTemplate,
+            static::class,
+            $this->actionMethodName
+        );
+        $this->eventDispatcher->dispatch($event);
+
         return $this->moduleTemplate->renderContent();
     }
 }
diff --git a/Classes/Event/ModuleTemplateWasPreparedForRendering.php b/Classes/Event/ModuleTemplateWasPreparedForRendering.php
new file mode 100644
index 000000000..2ad8d6361
--- /dev/null
+++ b/Classes/Event/ModuleTemplateWasPreparedForRendering.php
@@ -0,0 +1,65 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * Copyright notice
+ *
+ * (c) 2024 in2code.de and the following authors:
+ * Daniel Hoffmann <daniel.hoffmann@in2code.de>
+ *
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+namespace In2code\In2publishCore\Event;
+
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
+
+final class ModuleTemplateWasPreparedForRendering
+{
+    private ModuleTemplate $moduleTemplate;
+    private string $controllerClass;
+    private string $actionMethodName;
+
+    public function __construct(
+        ModuleTemplate $moduleTemplate,
+        string $controllerClass,
+        string $actionMethodName)
+    {
+        $this->moduleTemplate = $moduleTemplate;
+        $this->controllerClass = $controllerClass;
+        $this->actionMethodName = $actionMethodName;
+    }
+
+    public function getModuleTemplate(): ModuleTemplate
+    {
+        return $this->moduleTemplate;
+    }
+
+    public function getControllerClass(): string
+    {
+        return $this->controllerClass;
+    }
+
+    public function getActionMethodName(): string
+    {
+        return $this->actionMethodName;
+    }
+
+}
diff --git a/Documentation/Developers/Events/ModuleTemplateWasPreparedForRendering.md b/Documentation/Developers/Events/ModuleTemplateWasPreparedForRendering.md
new file mode 100644
index 000000000..8e31abe03
--- /dev/null
+++ b/Documentation/Developers/Events/ModuleTemplateWasPreparedForRendering.md
@@ -0,0 +1,38 @@
+# ModuleTemplateWasPreparedForRendering
+
+## When
+
+This event is fired each time a backend module is opened.
+
+## What
+
+* `moduleTemplate`: an object of type TYPO3\CMS\Backend\Template\ModuleTemplate
+* `controllerClass`: controller class calling the event
+* `actionMethodName`: action method name calling the event
+
+## Possibilities
+
+With this event you can add e.g. buttons to the docheader of a backend module.
+
+### Example
+
+This example shows you how to add a button to the docheader of the redirect module.
+
+```php
+use In2code\In2publish\Features\ContentLanguageControl\Toolbar\LanguageSelectionButtonInjection;
+use In2code\In2publishCore\Event\ModuleTemplateWasPreparedForRendering;
+use In2code\In2publishCore\Features\RedirectsSupport\Controller\RedirectController;
+
+class ModuleTemplateButtonBarSelectionRenderer
+{
+    use LanguageSelectionButtonInjection;
+
+    public function whenModuleTemplateWasPreparedForRendering(ModuleTemplateWasPreparedForRendering $event): void
+    {
+        if (RedirectController::class === $event->getControllerClass() && 'listAction' === $event->getActionMethodName()){
+            $moduleTemplate = $event->getModuleTemplate();
+            $moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton($this->languageSelectionButton);
+        }
+    }
+}
+```

From 0acabf2a5fcd4c0dcb6901025f5c6d98831e0cad Mon Sep 17 00:00:00 2001
From: Daniel Hoffmann <daniel.hoffmann@in2code.de>
Date: Tue, 12 Nov 2024 13:12:16 +0100
Subject: [PATCH 2/8] [FEATURE] Add event for filtering redirects in redirects
 module

Relates: https://projekte.in2code.de/issues/67976
---
 .../Controller/RedirectController.php         |  7 ++-
 .../Event/RedirectsWereFilteredForListing.php | 50 +++++++++++++++++++
 .../Events/RedirectsWereFilteredForListing.md | 44 ++++++++++++++++
 3 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 Classes/Features/RedirectsSupport/Event/RedirectsWereFilteredForListing.php
 create mode 100644 Documentation/Developers/Events/RedirectsWereFilteredForListing.md

diff --git a/Classes/Features/RedirectsSupport/Controller/RedirectController.php b/Classes/Features/RedirectsSupport/Controller/RedirectController.php
index e4a0d1648..10a185546 100644
--- a/Classes/Features/RedirectsSupport/Controller/RedirectController.php
+++ b/Classes/Features/RedirectsSupport/Controller/RedirectController.php
@@ -46,6 +46,7 @@
 use In2code\In2publishCore\Features\RedirectsSupport\Domain\Dto\Filter;
 use In2code\In2publishCore\Features\RedirectsSupport\Domain\Model\SysRedirectDatabaseRecord;
 use In2code\In2publishCore\Features\RedirectsSupport\Domain\Repository\SysRedirectRepository;
+use In2code\In2publishCore\Features\RedirectsSupport\Event\RedirectsWereFilteredForListing;
 use In2code\In2publishCore\Service\ForeignSiteFinderInjection;
 use Psr\Http\Message\ResponseInterface;
 use Throwable;
@@ -154,7 +155,11 @@ public function listAction(Filter $filter = null, int $page = 1): ResponseInterf
         $this->demandResolver->resolveDemand($demands, $recordCollection);
 
         $redirects = $this->getRedirectsByStateFromFilter($recordTree, $filter);
-        $paginator = new ArrayPaginator($redirects, $page, 15);
+
+        $event = new RedirectsWereFilteredForListing($redirects);
+        $this->eventDispatcher->dispatch($event);
+
+        $paginator = new ArrayPaginator($event->getRedirects(), $page, 15);
         $pagination = new SimplePagination($paginator);
         $this->view->assignMultiple(
             [
diff --git a/Classes/Features/RedirectsSupport/Event/RedirectsWereFilteredForListing.php b/Classes/Features/RedirectsSupport/Event/RedirectsWereFilteredForListing.php
new file mode 100644
index 000000000..3116f7d52
--- /dev/null
+++ b/Classes/Features/RedirectsSupport/Event/RedirectsWereFilteredForListing.php
@@ -0,0 +1,50 @@
+<?php
+
+declare(strict_types=1);
+
+/*
+ * Copyright notice
+ *
+ * (c) 2024 in2code.de and the following authors:
+ * Daniel Hoffmann <daniel.hoffmann@in2code.de>
+ *
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+namespace In2code\In2publishCore\Features\RedirectsSupport\Event;
+
+final class RedirectsWereFilteredForListing
+{
+    private array $redirects;
+
+    public function __construct(array $redirects)
+    {
+        $this->redirects = $redirects;
+    }
+
+    public function getRedirects(): array
+    {
+        return $this->redirects;
+    }
+
+    public function setRedirects(array $redirects): void
+    {
+        $this->redirects = $redirects;
+    }
+}
diff --git a/Documentation/Developers/Events/RedirectsWereFilteredForListing.md b/Documentation/Developers/Events/RedirectsWereFilteredForListing.md
new file mode 100644
index 000000000..c986e8533
--- /dev/null
+++ b/Documentation/Developers/Events/RedirectsWereFilteredForListing.md
@@ -0,0 +1,44 @@
+# RedirectsWereFilteredForListing
+
+## When
+
+The event is fired after the redirects are filtered for display in the listAction of the RedirectController.
+
+## What
+
+* `redirects`: an array of SysRedirectDatabaseRecord
+
+## Possibilities
+
+With this event you can filter the records in more detail on your own.
+
+### Example
+
+This example show how to filter the redirects with the Language Uid of the Parent Page.
+
+```php
+class FilterRedirectsBySelectedLanguages
+{
+    use UserSelectionServiceInjection;
+    use RawRecordServiceInjection;
+
+    public function __invoke(RedirectsWereFilteredForListing $event): void
+    {
+        $redirects = $event->getRedirects();
+        $selectedLanguages = [-1,0,4];
+
+        $redirects = array_filter($redirects, function (SysRedirectDatabaseRecord $redirect) use ($selectedLanguages) {
+            $pid = (int)$redirect->getLocalProps()['pid'];
+            if (0 === $pid) {
+                return true;
+            }
+            $record = $this->rawRecordService->getRawRecord('pages', $pid, 'local');
+            if (in_array($record['sys_language_uid'], $selectedLanguages)){
+                return true;
+            }
+        });
+
+        $event->setRedirects($redirects);
+    }
+}
+```

From 9e0877e25bf7c6706806bfe486df123901d043d5 Mon Sep 17 00:00:00 2001
From: Daniel Hoffmann <daniel.hoffmann@in2code.de>
Date: Tue, 19 Nov 2024 14:25:10 +0100
Subject: [PATCH 3/8] [FEATURE] Add Reasons Modal to Redirects

Relates: https://projekte.in2code.de/issues/67976
---
 .../ShowReasonsButtonViewHelper.php           | 78 +++++++++++++++++++
 .../Private/Language/de.locallang_mod5.xlf    |  4 +
 Resources/Private/Language/locallang_mod5.xlf |  3 +
 .../Private/Templates/Redirect/List.html      | 60 ++++++++------
 4 files changed, 121 insertions(+), 24 deletions(-)
 create mode 100644 Classes/Features/RedirectsSupport/ViewHelpers/ShowReasonsButtonViewHelper.php

diff --git a/Classes/Features/RedirectsSupport/ViewHelpers/ShowReasonsButtonViewHelper.php b/Classes/Features/RedirectsSupport/ViewHelpers/ShowReasonsButtonViewHelper.php
new file mode 100644
index 000000000..90e9327a8
--- /dev/null
+++ b/Classes/Features/RedirectsSupport/ViewHelpers/ShowReasonsButtonViewHelper.php
@@ -0,0 +1,78 @@
+<?php
+
+declare(strict_types=1);
+
+namespace In2code\In2publishCore\Features\RedirectsSupport\ViewHelpers;
+
+/*
+ * Copyright notice
+ *
+ * (c) 2024 in2code.de
+ * Daniel Hoffmann <daniel.hoffmann@in2code.de>
+ *
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+use In2code\In2publishCore\CommonInjection\TranslationConfigurationProviderInjection;
+use In2code\In2publishCore\Features\RedirectsSupport\Domain\Model\SysRedirectDatabaseRecord;
+use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
+use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
+use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
+
+class ShowReasonsButtonViewHelper extends AbstractTagBasedViewHelper
+{
+
+
+    protected $tagName = 'a';
+
+    public function initializeArguments(): void
+    {
+        parent::initializeArguments();
+        $this->registerUniversalTagAttributes();
+        $this->registerArgument('redirectRecord', SysRedirectDatabaseRecord::class, '', true);
+    }
+
+    public function render() : string
+    {
+        /**
+         * @var $redirectRecord SysRedirectDatabaseRecord
+         */
+        $redirectRecord = $this->arguments['redirectRecord'];
+        $this->tag->addAttribute('href','#');
+        $this->tag->setContent($this->renderChildren());
+        $modalConfiguration = [
+            'settings' => [
+                'title' => LocalizationUtility::translate('LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod5.xlf:modal.reasons.title'),
+                'content' => implode("\r\n", $redirectRecord->getReasonsWhyTheRecordIsNotPublishableHumanReadable()),
+                'severity' => 1,
+            ],
+            'buttons' => [
+                'abort' => [
+                    'text' => 'Abort',
+                    'btnClass' => 'btn btn-default',
+                    'name' => 'abort',
+                    'active' => true,
+                ]
+            ]
+        ];
+        $this->tag->addAttribute('data-modal-configuration', json_encode($modalConfiguration));
+
+        return $this->tag->render();
+    }
+}
diff --git a/Resources/Private/Language/de.locallang_mod5.xlf b/Resources/Private/Language/de.locallang_mod5.xlf
index 2afeaf36d..40889ccca 100755
--- a/Resources/Private/Language/de.locallang_mod5.xlf
+++ b/Resources/Private/Language/de.locallang_mod5.xlf
@@ -15,6 +15,10 @@
 				<source>TYPO3 Content Publisher - Redirects</source>
 				<target state="translated">TYPO3 Content Publisher - Redirects</target>
 			</trans-unit>
+			<trans-unit id="modal.reasons.title">
+				<source>Redirect is not publishable</source>
+				<target state="translated">Redirect kann nicht publiziert werden.</target>
+			</trans-unit>
 		</body>
 	</file>
 </xliff>
diff --git a/Resources/Private/Language/locallang_mod5.xlf b/Resources/Private/Language/locallang_mod5.xlf
index 00d2dbad2..6478faa51 100755
--- a/Resources/Private/Language/locallang_mod5.xlf
+++ b/Resources/Private/Language/locallang_mod5.xlf
@@ -12,6 +12,9 @@
 			<trans-unit id="mlang_labels_tablabel">
 				<source>TYPO3 Content Publisher - Redirects</source>
 			</trans-unit>
+			<trans-unit id="modal.reasons.title">
+				<source>Redirect is not publishable</source>
+			</trans-unit>
 		</body>
 	</file>
 </xliff>
diff --git a/Resources/Private/Templates/Redirect/List.html b/Resources/Private/Templates/Redirect/List.html
index 5bee90836..95ec37ccc 100644
--- a/Resources/Private/Templates/Redirect/List.html
+++ b/Resources/Private/Templates/Redirect/List.html
@@ -1,6 +1,7 @@
 <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
 	  xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
 	  xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
+	  xmlns:redirect="http://typo3.org/ns/In2code/In2publishCore/Features/RedirectsSupport/ViewHelpers"
 	  data-namespace-typo3-fluid="true"
 >
 	<f:layout name="Default"/>
@@ -65,30 +66,41 @@ <h2>
 											<core:icon identifier="actions-open"/>
 										</be:link.editRecord>
 									</f:if>
-									<f:switch expression="{redirect.publishingState}">
-										<f:case value="publishable">
-											<div class="btn-group">
-												<label class="btn btn-default btn-checkbox">
-													<f:form.checkbox title="Select for bulk publishing" value="{redirect.id}" style="margin: 0" name="redirects[]"/>
-													<f:variable name="viewPublishAll" value="1"/>
-													<span class="t3-icon fa"></span>
-												</label>
-												<f:link.action action="publish" class="btn btn-default" arguments="{redirects: {0: redirect.id}}" title="Publish">
-													<core:icon identifier="actions-caret-right" size="small"/>
-												</f:link.action>
-											</div>
-										</f:case>
-										<f:case value="siteRequired">
-											<f:link.action action="selectSite" class="btn btn-default" arguments="{redirect: redirect.id}" title="Publish with site association">
-												<core:icon identifier="actions-caret-right" overlay="overlay-external-link" size="small"/>
-											</f:link.action>
-										</f:case>
-										<f:case value="publishing">
-											<a href="#" class="btn btn-default disabled" title="This redirect is currently being published">
-												<core:icon identifier="spinner-circle" size="small"/>
-											</a>
-										</f:case>
-									</f:switch>
+									<f:if condition="!{redirect.reasonsWhyTheRecordIsNotPublishable.empty}">
+										<f:then>
+											<redirect:showReasonsButton class="btn btn-default js-in2publish-confirmation-modal" redirectRecord="{redirect}">
+												<span class="t3js-icon icon icon-size-small icon-state-default icon-actions-exclamation-triangle-alt" data-identifier="actions-exclamation-triangle-alt" aria-hidden="true">
+													<core:icon identifier="actions-exclamation-triangle-alt" />
+												</span>
+											</redirect:showReasonsButton>
+										</f:then>
+										<f:else>
+											<f:switch expression="{redirect.publishingState}">
+												<f:case value="publishable">
+													<div class="btn-group">
+														<label class="btn btn-default btn-checkbox">
+															<f:form.checkbox title="Select for bulk publishing" value="{redirect.id}" style="margin: 0" name="redirects[]"/>
+															<f:variable name="viewPublishAll" value="1"/>
+															<span class="t3-icon fa"></span>
+														</label>
+														<f:link.action action="publish" class="btn btn-default" arguments="{redirects: {0: redirect.id}}" title="Publish">
+															<core:icon identifier="actions-caret-right" size="small"/>
+														</f:link.action>
+													</div>
+												</f:case>
+												<f:case value="siteRequired">
+													<f:link.action action="selectSite" class="btn btn-default" arguments="{redirect: redirect.id}" title="Publish with site association">
+														<core:icon identifier="actions-caret-right" overlay="overlay-external-link" size="small"/>
+													</f:link.action>
+												</f:case>
+												<f:case value="publishing">
+													<a href="#" class="btn btn-default disabled" title="This redirect is currently being published">
+														<core:icon identifier="spinner-circle" size="small"/>
+													</a>
+												</f:case>
+											</f:switch>
+										</f:else>
+									</f:if>
 								</td>
 							</tr>
 						</f:for>

From 03c13172d110572ba90f3283ec6e222bac6101eb Mon Sep 17 00:00:00 2001
From: Daniel Hoffmann <daniel.hoffmann@in2code.de>
Date: Tue, 19 Nov 2024 14:30:46 +0100
Subject: [PATCH 4/8] [CODESTYLE] Fix Codestyle

- Remove unused import
- Remove empty lines
- Change Line Breaks
---
 .../Core/Repository/SingleDatabaseRepository.php     |  6 ++----
 .../Event/ModuleTemplateWasPreparedForRendering.php  |  5 ++---
 .../ViewHelpers/ShowReasonsButtonViewHelper.php      | 12 ++++--------
 3 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/Classes/Component/Core/Repository/SingleDatabaseRepository.php b/Classes/Component/Core/Repository/SingleDatabaseRepository.php
index 6f2d499fb..7e8226692 100644
--- a/Classes/Component/Core/Repository/SingleDatabaseRepository.php
+++ b/Classes/Component/Core/Repository/SingleDatabaseRepository.php
@@ -148,12 +148,10 @@ public function findByPropertyWithJoin(
                 $splitRow['mmtbl']['uid_local'],
                 $splitRow['mmtbl']['uid_foreign'],
             ];
-            if(isset($splitRow['mmtbl']['tablenames']))
-            {
+            if (isset($splitRow['mmtbl']['tablenames'])) {
                 $mmIdentityProperties[] = $splitRow['mmtbl']['tablenames'];
             }
-            if(isset($splitRow['mmtbl']['fieldname']))
-            {
+            if (isset($splitRow['mmtbl']['fieldname'])) {
                 $mmIdentityProperties[] = $splitRow['mmtbl']['fieldname'];
             }
             $splitRows[hash('sha1', json_encode($mmIdentityProperties, JSON_THROW_ON_ERROR))] = $splitRow;
diff --git a/Classes/Event/ModuleTemplateWasPreparedForRendering.php b/Classes/Event/ModuleTemplateWasPreparedForRendering.php
index 2ad8d6361..29ee1bf86 100644
--- a/Classes/Event/ModuleTemplateWasPreparedForRendering.php
+++ b/Classes/Event/ModuleTemplateWasPreparedForRendering.php
@@ -40,8 +40,8 @@ final class ModuleTemplateWasPreparedForRendering
     public function __construct(
         ModuleTemplate $moduleTemplate,
         string $controllerClass,
-        string $actionMethodName)
-    {
+        string $actionMethodName
+    ) {
         $this->moduleTemplate = $moduleTemplate;
         $this->controllerClass = $controllerClass;
         $this->actionMethodName = $actionMethodName;
@@ -61,5 +61,4 @@ public function getActionMethodName(): string
     {
         return $this->actionMethodName;
     }
-
 }
diff --git a/Classes/Features/RedirectsSupport/ViewHelpers/ShowReasonsButtonViewHelper.php b/Classes/Features/RedirectsSupport/ViewHelpers/ShowReasonsButtonViewHelper.php
index 90e9327a8..ff49712c8 100644
--- a/Classes/Features/RedirectsSupport/ViewHelpers/ShowReasonsButtonViewHelper.php
+++ b/Classes/Features/RedirectsSupport/ViewHelpers/ShowReasonsButtonViewHelper.php
@@ -29,16 +29,12 @@
  * This copyright notice MUST APPEAR in all copies of the script!
  */
 
-use In2code\In2publishCore\CommonInjection\TranslationConfigurationProviderInjection;
 use In2code\In2publishCore\Features\RedirectsSupport\Domain\Model\SysRedirectDatabaseRecord;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
 
 class ShowReasonsButtonViewHelper extends AbstractTagBasedViewHelper
 {
-
-
     protected $tagName = 'a';
 
     public function initializeArguments(): void
@@ -48,13 +44,13 @@ public function initializeArguments(): void
         $this->registerArgument('redirectRecord', SysRedirectDatabaseRecord::class, '', true);
     }
 
-    public function render() : string
+    public function render(): string
     {
         /**
          * @var $redirectRecord SysRedirectDatabaseRecord
          */
         $redirectRecord = $this->arguments['redirectRecord'];
-        $this->tag->addAttribute('href','#');
+        $this->tag->addAttribute('href', '#');
         $this->tag->setContent($this->renderChildren());
         $modalConfiguration = [
             'settings' => [
@@ -68,8 +64,8 @@ public function render() : string
                     'btnClass' => 'btn btn-default',
                     'name' => 'abort',
                     'active' => true,
-                ]
-            ]
+                ],
+            ],
         ];
         $this->tag->addAttribute('data-modal-configuration', json_encode($modalConfiguration));
 

From 1e41968b0f8bce5e684f3c22caba9faf151ccd10 Mon Sep 17 00:00:00 2001
From: Daniel Hoffmann <daniel.hoffmann@in2code.de>
Date: Thu, 21 Nov 2024 12:55:10 +0100
Subject: [PATCH 5/8] [BUGFIX] respect unchanged redirect

Relates: https://projekte.in2code.de/issues/62544
---
 Resources/Private/Templates/Redirect/List.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Resources/Private/Templates/Redirect/List.html b/Resources/Private/Templates/Redirect/List.html
index 95ec37ccc..01d57dc2a 100644
--- a/Resources/Private/Templates/Redirect/List.html
+++ b/Resources/Private/Templates/Redirect/List.html
@@ -66,7 +66,7 @@ <h2>
 											<core:icon identifier="actions-open"/>
 										</be:link.editRecord>
 									</f:if>
-									<f:if condition="!{redirect.reasonsWhyTheRecordIsNotPublishable.empty}">
+									<f:if condition="{redirect.publishingState} != 'unchanged' && !{redirect.reasonsWhyTheRecordIsNotPublishable.empty}">
 										<f:then>
 											<redirect:showReasonsButton class="btn btn-default js-in2publish-confirmation-modal" redirectRecord="{redirect}">
 												<span class="t3js-icon icon icon-size-small icon-state-default icon-actions-exclamation-triangle-alt" data-identifier="actions-exclamation-triangle-alt" aria-hidden="true">

From 71745a171d68b358f9100c46b389fcf704e8f186 Mon Sep 17 00:00:00 2001
From: Christine Zoglmeier <christine.zoglmeier@in2code.de>
Date: Wed, 27 Nov 2024 10:26:29 +0100
Subject: [PATCH 6/8] [META] Set the EM conf version number to 12.5.7

---
 ext_emconf.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext_emconf.php b/ext_emconf.php
index 3d4ef1701..e7f3d1a74 100755
--- a/ext_emconf.php
+++ b/ext_emconf.php
@@ -9,7 +9,7 @@
     'title' => 'in2publish Core',
     'description' => 'Content publishing extension to connect stage and production server',
     'category' => 'plugin',
-    'version' => '12.5.6',
+    'version' => '12.5.7',
     'state' => 'stable',
     'clearCacheOnLoad' => true,
     'author' => 'Alex Kellner, Oliver Eglseder, Thomas Scheibitz, Stefan Busemann',

From ea22dd5c882e48c6380991190368ba014c84a17f Mon Sep 17 00:00:00 2001
From: Christine Zoglmeier <christine.zoglmeier@in2code.de>
Date: Wed, 27 Nov 2024 10:30:15 +0100
Subject: [PATCH 7/8] [DOCS] Adjust changelog for previous versions

---
 CHANGELOG.md | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3d83fea7c..523d5fb0c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,8 @@
 # In2publish Core Change Log
 
 12.5.6:
+
+- [META] Set the EM conf version number to 12.5.6
 - [TEST] Adjust PublishChangedContentTest
 - [BUGFIX] Fix publishbackgroundall dependency index
 - [BUGFIX] Fix DirtyProperties of Redirect
@@ -9,6 +11,8 @@
 - [BUGFIX] Implement suggested bugfix for duplicate key exception
 
 12.5.5:
+
+- [META] Set the EM conf version number to 12.5.5
 - [BUGFIX] Correct Response of Compare Tool
 - [BUGFIX] Make ResolverService public
 - [BUGFIX] Fix cache clear task
@@ -16,11 +20,14 @@
 - [TASK] Make search in file module case-insensitive
 
 12.5.4:
+
+- [META] Set the EM conf version number to 12.5.4
 - [BUGFIX] Enable Logging in Command on foreign
 - [BUGFIX] LogLevel is evaluated correctly
 
 12.5.3:
 
+- [META] Set the EM conf version number to 12.5.3
 - [CODESTYLE] Make qa happy
 - [BUGFIX] Add make target for installing qa tools
 - [FEATURE] Adds Support for MM-Records to excluded Tables
@@ -43,6 +50,7 @@
 
 12.5.2:
 
+- [META] Set the EM conf version number to 12.5.2
 - [DOCS] Add known issue to explain missing (orphaned) MM records in the record tree
 - [BUGFIX] Discard the table portion of a joined row if the joined record does not exist
 - [META] Exclude compile-sass from archive
@@ -50,6 +58,7 @@
 
 12.5.1:
 
+- [META] Set the EM conf version number to 12.5.1
 - [BUGFIX] Correct evaluation of publishing state
 - [BUGFIX] Fixes Databender for Redirects
 

From 8ca8c6923cd962817ce498db5929fce0e456da50 Mon Sep 17 00:00:00 2001
From: Christine Zoglmeier <christine.zoglmeier@in2code.de>
Date: Wed, 27 Nov 2024 10:34:21 +0100
Subject: [PATCH 8/8] [DOCS] Adjust changelog

---
 CHANGELOG.md | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 523d5fb0c..e5d36e232 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
 # In2publish Core Change Log
 
+12.5.7
+
+- [META] Set the EM conf version number to 12.5.7
+- [BUGFIX] respect unchanged redirect
+- [CODESTYLE] Fix Codestyle
+- [FEATURE] Add Reasons Modal to Redirects
+- [FEATURE] Add event for filtering redirects in redirects module
+- [FEATURE] Add event for editing module template
+
 12.5.6:
 
 - [META] Set the EM conf version number to 12.5.6