Skip to content

Commit

Permalink
[BUGFIX] Update display of start page field in "LinkValidator" task
Browse files Browse the repository at this point in the history
In the "LinkValidator" scheduler task, you need to select a start page.
The button to select this page does not match the FormEngine markup.
which is fixed with this patch.

Resolves: #102462
Releases: main, 12.4
Change-Id: I213fde08a8a13bee462cdc3371514ce27c9e3e97
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81926
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
minapok authored and lolli42 committed Nov 23, 2023
1 parent 9c411f5 commit 30a0a2e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
Expand Up @@ -118,19 +118,22 @@ public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleCont
}
}
$fieldId = 'task_page';
$pageUid = '';
$pageTitle = '';
if (!empty($taskInfo['page'])) {
$pageUid = (int)$taskInfo['page'];
$pageTitle = $this->getPageTitle((int)$taskInfo['page']);
}
$fieldCode = '<input type="number" min="0" class="form-control form-control-clearable t3js-clearable" name="tx_scheduler[linkvalidator][page]" id="'
. $fieldId
. '" value="'
. htmlspecialchars((string)$taskInfo['page'])
. '">';
$label = $lang->sL($this->languageFile . ':tasks.validate.page');
$pageTitle = '';
if (!empty($taskInfo['page'])) {
$pageTitle = $this->getPageTitle((int)$taskInfo['page']);
}
$additionalFields[$fieldId] = [
'browser' => 'page',
'pageTitle' => $pageTitle,
'pageUid' => $pageUid,
'code' => $fieldCode,
'cshTable' => 'linkvalidator',
'cshLabel' => $fieldId,
Expand Down
Expand Up @@ -794,6 +794,7 @@ protected function addPreparedAdditionalFields(array $currentAdditionalFields, a
'langLabel' => $this->getLanguageService()->sL($fieldInfo['label'] ?? ''),
'browser' => $fieldInfo['browser'] ?? '',
'pageTitle' => $fieldInfo['pageTitle'] ?? '',
'pageUid' => $fieldInfo['pageUid'] ?? '',
'type' => $fieldInfo['type'] ?? '',
'description' => $fieldInfo['description'] ?? '',
];
Expand Down
Expand Up @@ -25,7 +25,7 @@
<f:if condition="{field.browser} == 'page'">
<f:then>
<f:comment><!-- A page browser button. Used in ext:linkvalidator task. See issue #12211. --></f:comment>
<div class="formengine-field-item">
<div class="formengine-field-item t3js-formengine-field-item">
<div class="form-wizards-wrap">
<div class="form-wizards-element">
{field.code -> f:format.raw()}
Expand All @@ -34,20 +34,32 @@
<div class="btn-group-vertical">
<f:be.link
route="wizard_element_browser"
class="btn btn-default t3js-element-browser"
class="t3js-element-browser btn btn-default"
data="{trigger-for: field.fieldID, mode:'db'}"
title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.browse_db')}"
>
<core:icon identifier="actions-insert-record" />
</f:be.link>
<span
title="{f:translate(key: 'LLL:EXT:typo3/sysext/core/Resources/Private/Language/locallang_core.xlf:labels.browse_db')}"
id="page_{field.fieldID}"
>
{field.pageTitle}
</span>
</div>
</div>
<f:if condition="{field.pageUid}">
<div class="form-wizards-items-bottom">
<div class="table-fit mt-1 mb-0">
<table class="table">
<tbody>
<tr>
<td class="col-icon">
<core:icon identifier="apps-pagetree-page-default" />
</td>
<td class="col-title">
<span class="text-body-secondary">{field.pageTitle} [{field.pageUid}]</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</f:if>
</div>
</div>
</f:then>
Expand Down

0 comments on commit 30a0a2e

Please sign in to comment.