Commit 77cd9436 authored by Michael Oehlhof's avatar Michael Oehlhof Committed by Andreas Fernandez
Browse files

[BUGFIX] EXT:linkvalidator Keep field content when saving new task

When saving a new linkvalidator task in the scheduler and the validation
failed, now the previous input is kept in the external fields.

Resolves: #79056
Releases: master
Change-Id: Ib629f47890f2972de8c8bfa28644ef933357c374
Reviewed-on: https://review.typo3.org/51011

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Philipp Gampe's avatarPhilipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe's avatarPhilipp Gampe <philipp.gampe@typo3.org>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
parent c95fea47
......@@ -48,7 +48,7 @@ class ValidatorTaskAdditionalFieldProvider implements AdditionalFieldProviderInt
$additionalFields = [];
if (empty($taskInfo['configuration'])) {
if ($schedulerModule->CMD === 'add') {
$taskInfo['configuration'] = '';
$taskInfo['configuration'] = $taskInfo['linkvalidator']['configuration'];
} elseif ($schedulerModule->CMD === 'edit') {
$taskInfo['configuration'] = $task->getConfiguration();
} else {
......@@ -57,7 +57,7 @@ class ValidatorTaskAdditionalFieldProvider implements AdditionalFieldProviderInt
}
if (empty($taskInfo['depth'])) {
if ($schedulerModule->CMD === 'add') {
$taskInfo['depth'] = [];
$taskInfo['depth'] = $taskInfo['linkvalidator']['depth'];
} elseif ($schedulerModule->CMD === 'edit') {
$taskInfo['depth'] = $task->getDepth();
} else {
......@@ -66,7 +66,7 @@ class ValidatorTaskAdditionalFieldProvider implements AdditionalFieldProviderInt
}
if (empty($taskInfo['page'])) {
if ($schedulerModule->CMD === 'add') {
$taskInfo['page'] = '';
$taskInfo['page'] = $taskInfo['linkvalidator']['page'];
} elseif ($schedulerModule->CMD === 'edit') {
$taskInfo['page'] = $task->getPage();
} else {
......@@ -75,7 +75,7 @@ class ValidatorTaskAdditionalFieldProvider implements AdditionalFieldProviderInt
}
if (empty($taskInfo['email'])) {
if ($schedulerModule->CMD === 'add') {
$taskInfo['email'] = '';
$taskInfo['email'] = $taskInfo['linkvalidator']['email'];
} elseif ($schedulerModule->CMD === 'edit') {
$taskInfo['email'] = $task->getEmail();
} else {
......@@ -84,7 +84,7 @@ class ValidatorTaskAdditionalFieldProvider implements AdditionalFieldProviderInt
}
if (empty($taskInfo['emailOnBrokenLinkOnly'])) {
if ($schedulerModule->CMD === 'add') {
$taskInfo['emailOnBrokenLinkOnly'] = 1;
$taskInfo['emailOnBrokenLinkOnly'] = $taskInfo['linkvalidator']['emailOnBrokenLinkOnly'] ? $taskInfo['linkvalidator']['emailOnBrokenLinkOnly'] : 1;
} elseif ($schedulerModule->CMD === 'edit') {
$taskInfo['emailOnBrokenLinkOnly'] = $task->getEmailOnBrokenLinkOnly();
} else {
......@@ -93,7 +93,7 @@ class ValidatorTaskAdditionalFieldProvider implements AdditionalFieldProviderInt
}
if (empty($taskInfo['emailTemplateFile'])) {
if ($schedulerModule->CMD === 'add') {
$taskInfo['emailTemplateFile'] = 'EXT:linkvalidator/Resources/Private/Templates/mailtemplate.html';
$taskInfo['emailTemplateFile'] = $taskInfo['linkvalidator']['emailTemplateFile'] ? $taskInfo['linkvalidator']['emailTemplateFile'] : 'EXT:linkvalidator/Resources/Private/Templates/mailtemplate.html';
} elseif ($schedulerModule->CMD === 'edit') {
$taskInfo['emailTemplateFile'] = $task->getEmailTemplateFile();
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment