Skip to content

Commit

Permalink
[BUGFIX] Added check for fieldname to prevent adding videos to queue …
Browse files Browse the repository at this point in the history
…when copying pages
  • Loading branch information
ManuS3009 committed Aug 25, 2023
1 parent a2320b6 commit e5bec78
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Classes/Service/WebmConverterService.php
Expand Up @@ -163,7 +163,7 @@ public function convertVideoToWebM(File $originalVideoFile): ?File
* @return void
* @throws IllegalObjectTypeException
*/
public function addVideoToQueue(File $originalVideoFile, array $datamap, string $newId, array $substNEWwithIDs)
public function addVideoToQueue(File $originalVideoFile, array $datamap, string $newId, array $substNEWwithIDs): bool
{
$tablenames = array_key_first($datamap);
$fieldname = '';
Expand Down Expand Up @@ -195,7 +195,9 @@ public function addVideoToQueue(File $originalVideoFile, array $datamap, string

$this->queueItemRepository->add($newQueueItem);
$this->persistenceManager->persistAll();
return true;
}
return false;
}

/**
Expand Down Expand Up @@ -235,8 +237,9 @@ public function handleVideoConvertion(array &$fieldArray, DataHandler $pObj, str
$this->addFlashMessage('', LocalizationUtility::translate('LLL:EXT:webm/Resources/Private/Language/locallang_db.xlf:tx_webm_domain_model_queueitem.convertionSuccessful', 'webm'), ContextualFeedbackSeverity::OK);

} else {
$this->addVideoToQueue($file, $pObj->datamap, $newId, $pObj->substNEWwithIDs);
$this->addFlashMessage('', LocalizationUtility::translate('LLL:EXT:webm/Resources/Private/Language/locallang_db.xlf:tx_webm_domain_model_queueitem.addVideoToQueueSuccessful', 'webm'), ContextualFeedbackSeverity::OK);
if($this->addVideoToQueue($file, $pObj->datamap, $newId, $pObj->substNEWwithIDs)) {
$this->addFlashMessage('', LocalizationUtility::translate('LLL:EXT:webm/Resources/Private/Language/locallang_db.xlf:tx_webm_domain_model_queueitem.addVideoToQueueSuccessful', 'webm'), ContextualFeedbackSeverity::OK);
}
}
}
}
Expand Down

0 comments on commit e5bec78

Please sign in to comment.