Open loco8878 opened 9 years ago
Steps to reproduce the issue on a stock TYPO3 system:
The selector closes. The TYPO3 page will show a popup that a 500 error occured on the server:
Error: 500 Internal Server error
Strangely it works with a .png file.
This happens with media 3.5.1/vidi 0.9.0.
The data-uid attribute is missing on video items in the pop-up browser. To add it, the method renderTagAnchor
in the file EXT:media/Classes/Thumbnail/VideoThumbnailProcessor.php
has to be changed. See:
/**
* Render a wrapping anchor around the thumbnail.
*
* @param string $result
* @return string
*/
public function renderTagAnchor($result) {
$file = $this->getFile();
return sprintf('<a href="%s%s" target="%s" data-uid="%s">%s</a>',
$this->thumbnailService->getAnchorUri() ? $this->thumbnailService->getAnchorUri() : $file->getPublicUrl(TRUE),
$this->thumbnailService->getAppendTimeStamp() ? '?' . $file->getProperty('tstamp') : '',
$this->thumbnailService->getTarget(),
$file->getUid(),
$result
);
}
I turned off thumbnail generation in the TCA because I don't know about the capability of TYPO3 to generate thumbs from various video files and didn't do testing on it. Here how it was done:
$GLOBALS['TCA']['tx_myextension_domain_model_mymodel']['columns']['video']['config'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'video',
array(
'maxitems' => 1,
'appearance' => array(
'useSortable' => TRUE,
'headerThumbnail' => FALSE, // <--- this is the important part here, everything else is copied from the getFileFieldTCAConfig method
'showPossibleLocalizationRecords' => FALSE,
'showRemovedLocalizationRecords' => FALSE,
'showSynchronizationLink' => FALSE,
'showAllLocalizationLink' => FALSE,
'enabledControls' => array(
'info' => TRUE,
'new' => FALSE,
'dragdrop' => TRUE,
'sort' => FALSE,
'hide' => TRUE,
'delete' => TRUE,
'localize' => TRUE,
),
),
),
'*'
);
Reproduction
Uncaught TYPO3 Exception
1300096564: uid of file has to be numeric. (More information)
InvalidArgumentException thrown in file typo3/sysext/core/Classes/Resource/ResourceFactory.php in line 340.
8 TYPO3\CMS\Core\Resource\ResourceFactory::getFileObject("undefined")