From 67e0d07ab6439ed53afe89c07b2232608c671b5a Mon Sep 17 00:00:00 2001
From: Frank Naegler <frank.naegler@typo3.org>
Date: Mon, 21 Aug 2017 21:36:14 +0200
Subject: [PATCH] [BUGFIX] Fix broken table layout of Upgrade Wizards table

Resolves: #82150
Releases: master
Change-Id: I962a41df0f0375bbf1b325f29d270d8fe2da0e5f
Reviewed-on: https://review.typo3.org/53761
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../Action/Tool/Upgrade/UpgradeWizards.html   | 28 ++++++++++---------
 .../JavaScript/Modules/UpgradeWizards.js      |  9 +++---
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/Upgrade/UpgradeWizards.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/Upgrade/UpgradeWizards.html
index d4def5b19190..646a7405340e 100644
--- a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/Upgrade/UpgradeWizards.html
+++ b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/Upgrade/UpgradeWizards.html
@@ -77,24 +77,26 @@
 	</div>
 
 	<div class="t3js-upgradeWizards-done-body-template">
-		<table class="table table-striped">
+		<table class="table table-condensed table-striped">
 			<tbody class="t3js-upgradeWizards-done-rows"></tbody>
 		</table>
 	</div>
 	<div class="t3js-upgradeWizards-done-row-template">
 		<table>
-			<tr>
-				<td>
-					<button
-						type="button"
-						class="btn btn-default t3js-upgradeWizards-done-markUndone"
-					>
-						Mark undone
-					</button>
-				</td>
-				<td class="t3js-upgradeWizards-done-title">
-				</td>
-			</tr>
+			<tbody class="this table and tbody tag will be removed in JS, only the tr is used!">
+				<tr>
+					<td>
+						<button
+							type="button"
+							class="btn btn-default t3js-upgradeWizards-done-markUndone"
+						>
+							Mark undone
+						</button>
+					</td>
+					<td class="t3js-upgradeWizards-done-title">
+					</td>
+				</tr>
+			</tbody>
 		</table>
 	</div>
 </div>
diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Modules/UpgradeWizards.js b/typo3/sysext/install/Resources/Public/JavaScript/Modules/UpgradeWizards.js
index dd7e19d96791..060e2918b93f 100644
--- a/typo3/sysext/install/Resources/Public/JavaScript/Modules/UpgradeWizards.js
+++ b/typo3/sysext/install/Resources/Public/JavaScript/Modules/UpgradeWizards.js
@@ -36,7 +36,7 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
 		selectorWizardsBlockingCharsetFix: '.t3js-upgradeWizards-blocking-charset-fix',
 		selectorWizardsDoneBodyTemplate: '.t3js-upgradeWizards-done-body-template',
 		selectorWizardsDoneRows: '.t3js-upgradeWizards-done-rows',
-		selectorWizardsDoneRowTemplate: '.t3js-upgradeWizards-done-row-template table',
+		selectorWizardsDoneRowTemplate: '.t3js-upgradeWizards-done-row-template table tbody',
 		selectorWizardsDoneRowMarkUndone: '.t3js-upgradeWizards-done-markUndone',
 		selectorWizardsDoneRowTitle: '.t3js-upgradeWizards-done-title',
 		selectorWizardsListTemplate: '.gridder-show .t3js-upgradeWizards-list-template',
@@ -425,13 +425,14 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
 						}
 						var body = $(bodyTemplate).clone();
 						var hasBodyContent = false;
+						var $wizardsDoneContainer = body.find(self.selectorWizardsDoneRows);
 						if (Array.isArray(data.wizardsDone) && data.wizardsDone.length > 0) {
 							data.wizardsDone.forEach(function(element) {
 								hasBodyContent = true;
 								var aRow = $(rowTemplate).clone();
 								aRow.find(self.selectorWizardsDoneRowMarkUndone).data('identifier', element.identifier);
-								aRow.find(self.selectorWizardsDoneRowTitle).html(element.title);
-								body.find(self.selectorWizardsDoneRows).append(aRow);
+								aRow.find(self.selectorWizardsDoneRowTitle).text(element.title);
+								$wizardsDoneContainer.append(aRow);
 							});
 						}
 						if (Array.isArray(data.rowUpdatersDone) && data.rowUpdatersDone.length > 0) {
@@ -440,7 +441,7 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
 								var aRow = $(rowTemplate).clone();
 								aRow.find(self.selectorWizardsDoneRowMarkUndone).data('identifier', element.identifier);
 								aRow.find(self.selectorWizardsDoneRowTitle).html(element.title);
-								body.find(self.selectorWizardsDoneRows).append(aRow);
+								$wizardsDoneContainer.append(aRow);
 							});
 						}
 						if (hasBodyContent === true) {
-- 
GitLab