-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Scheduler tasks for indexing, reindexing and harvesting of documents #1119
base: master
Are you sure you want to change the base?
[FEATURE] Scheduler tasks for indexing, reindexing and harvesting of documents #1119
Conversation
@frank-ulrich-weber: Could you please fix the PHPStan and Codacy issues? |
At the moment I don't know how to resolve the remaining issues. The PHPStan and the first two Codays issues are correct but specified by the method signature of the scheduler interface. Additionaly I have no idea how to prevent the Cyclomatic Complexity of validateAdditionalFields() in a sensible way. Any hints? Thanks. |
@@ -160,7 +160,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int | |||
|
|||
if ($document === null) { | |||
$io->error('ERROR: Document with UID "' . $input->getOption('doc') . '" could not be found on PID ' . $this->storagePid . ' .'); | |||
exit(1); | |||
return 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return 1; | |
return BaseCommand::FAILURE; |
use Kitodo\Dlf\Common\Helper; | ||
use TYPO3\CMS\Core\Messaging\FlashMessage; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface; | ||
use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; | ||
use TYPO3\CMS\Scheduler\Task\AbstractTask; | ||
use TYPO3\CMS\Backend\Tree\Repository\PageTreeRepository; | ||
use TYPO3\CMS\Core\Database\ConnectionPool; | ||
use TYPO3\CMS\Core\Database\Connection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use Kitodo\Dlf\Common\Helper; | |
use TYPO3\CMS\Core\Messaging\FlashMessage; | |
use TYPO3\CMS\Core\Utility\GeneralUtility; | |
use TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface; | |
use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; | |
use TYPO3\CMS\Scheduler\Task\AbstractTask; | |
use TYPO3\CMS\Backend\Tree\Repository\PageTreeRepository; | |
use TYPO3\CMS\Core\Database\ConnectionPool; | |
use TYPO3\CMS\Core\Database\Connection; | |
use Kitodo\Dlf\Common\Helper; | |
use TYPO3\CMS\Backend\Tree\Repository\PageTreeRepository; | |
use TYPO3\CMS\Core\Database\Connection; | |
use TYPO3\CMS\Core\Database\ConnectionPool; | |
use TYPO3\CMS\Core\Messaging\FlashMessage; | |
use TYPO3\CMS\Core\Utility\GeneralUtility; | |
use TYPO3\CMS\Scheduler\AdditionalFieldProviderInterface; | |
use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; |
Please import namespaces in alphabetical order for better readibility.
return $fieldsValid; | ||
} | ||
|
||
public function saveAdditionalFields(array $submittedData, AbstractTask $task) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function saveAdditionalFields(array $submittedData, AbstractTask $task) | |
public function saveAdditionalFields(array $submittedData, BaseTask $task) |
PHPStan correctly mentions all the calls to undefined methods in this method. That's because you declare $task
as being of type AbstractTask
, but then call methods which are only defined in BaseTask
. I think declaring $task
as being of type BaseTask
should fix this. (On the other hand this may break the interface compatibility...)
Pres_01-2023_Solr-Verbesserungen:
A task for optimizing the index will be added when this is merged.