From ea143a3cac11b6dbd2e757b81fa323c8e4de0fcd Mon Sep 17 00:00:00 2001
From: Oliver Bartsch <bo@cedev.de>
Date: Mon, 22 Apr 2024 09:39:29 +0200
Subject: [PATCH] [BUGFIX] Link root page title in site configuration module
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

To be consistent with the other listings in the
backend is the root page title of a site in the
site configuration module now linked, allowing
to edit the corresponding site configuration.

Additionally does the link as well as the
edit button now use a dedicated label instead
of a generic one.

Resolves: #103695
Releases: main, 12.4
Change-Id: Ice46e82587cdc36daa6275f6eec2c46909e8a071
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83950
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Jasmina Ließmann <minapokhalo+typo3@gmail.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Jasmina Ließmann <minapokhalo+typo3@gmail.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
---
 .../Language/locallang_siteconfiguration.xlf        |  3 +++
 .../Templates/SiteConfiguration/Overview.html       | 13 +++++++++++--
 .../Acceptance/Application/Site/SiteModuleCest.php  |  2 +-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration.xlf b/typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration.xlf
index 651f09bc2078..e95c73ad861c 100644
--- a/typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration.xlf
+++ b/typo3/sysext/backend/Resources/Private/Language/locallang_siteconfiguration.xlf
@@ -24,6 +24,9 @@
 			<trans-unit id="overview.addSiteConfiguration" resname="overview.addSiteConfiguration">
 				<source>Add new site configuration for this site</source>
 			</trans-unit>
+			<trans-unit id="overview.editSiteConfiguration" resname="overview.editSiteConfiguration">
+				<source>Edit site configuration</source>
+			</trans-unit>
 			<trans-unit id="overview.deleteSiteConfiguration" resname="overview.deleteSiteConfiguration">
 				<source>Delete site configuration</source>
 			</trans-unit>
diff --git a/typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Overview.html b/typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Overview.html
index f23286777373..30d3fdf2000c 100644
--- a/typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Overview.html
+++ b/typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Overview.html
@@ -92,7 +92,16 @@
                                     </button>
                                 </td>
                                 <td class="align-top">
-                                    {rootPage.title}
+                                    <f:if condition="{page.siteIdentifier}">
+                                        <f:then>
+                                            <f:be.link route="site_configuration.edit" parameters="{site: page.siteIdentifier}" title="{f:translate(key:'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.editSiteConfiguration')}">
+                                                {rootPage.title}
+                                            </f:be.link>
+                                        </f:then>
+                                        <f:else>
+                                            {rootPage.title}
+                                        </f:else>
+                                    </f:if>
                                 </td>
                                 <td class="align-top">
                                     <f:if condition="{page.siteIdentifier}">
@@ -137,7 +146,7 @@
                                 <td class="align-top nowrap col-control">
                                     <div class="btn-group">
                                         <f:if condition="{page.siteIdentifier}">
-                                            <f:be.link route="site_configuration.edit" parameters="{site: page.siteIdentifier}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:edit')}" class="btn btn-default">
+                                            <f:be.link route="site_configuration.edit" parameters="{site: page.siteIdentifier}" title="{f:translate(key:'LLL:EXT:backend/Resources/Private/Language/locallang_siteconfiguration.xlf:overview.editSiteConfiguration')}" class="btn btn-default">
                                                 <core:icon identifier="actions-open" />
                                             </f:be.link>
                                             <button
diff --git a/typo3/sysext/core/Tests/Acceptance/Application/Site/SiteModuleCest.php b/typo3/sysext/core/Tests/Acceptance/Application/Site/SiteModuleCest.php
index 2db479a02059..5a17b7c907c7 100644
--- a/typo3/sysext/core/Tests/Acceptance/Application/Site/SiteModuleCest.php
+++ b/typo3/sysext/core/Tests/Acceptance/Application/Site/SiteModuleCest.php
@@ -38,7 +38,7 @@ final class SiteModuleCest
         $I->see('Site Configuration', 'h1');
 
         $I->amGoingTo('edit an automatically created site configuration');
-        $I->click('Edit');
+        $I->click('Edit site configuration');
         $I->waitForElementNotVisible('#t3js-ui-block');
         $I->see('Edit Site Configuration', 'h1');
 
-- 
GitLab