Actions
Bug #104201
closedCreation of a file relation in a data record not possible
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2024-06-25
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
Hello,
when creating a relation (Image) in a data record, sometimes no relation can be set.
The link handler can be opened in this case, but no image can be selected. After waiting a while, you get a js error in the browser console
The system is a new installation of TYPO 3 v11.5, in which only the TCA and the domain model for the data set were configured.
The configuration is as follows:
packages/main/Classes/Domain/Model/PressPhoto
<?php
namespace playground\main\Domain\Model;
use TYPO3\CMS\Extbase\Annotation\ORM\Cascade;
use TYPO3\CMS\Extbase\Domain\Model\Category;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
class PressPhoto extends AbstractEntity
{
/**
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
*/
protected $image = NULL;
/**
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $image
*/
public function getImages(): FileReference
{
return $this->images;
}
/**
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $image
* @return void
*/
public function setImages(FileReference $images): void
{
$this->images = $images;
}
}
packages/main/Classes/Domain/Repository/PressPhotoRepository;
<?php
namespace playground\main\Domain\Repository;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
class PressPhotoRepository extends Repository
{
}
packages/main/Configuration/TCA/tx_main_domain_model_pressphoto.php
<?php
return [
'ctrl' => [
'title' => 'Pressefotos',
'label' => 'title',
'iconfile' => 'EXT:main/Resources/Public/Icons/Extension.png',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'versioningWS' => false,
'origUid' => 't3_origuid',
'delete' => 'deleted',
'transOrigPointerField' => 'l18n_parent',
'translationSource' => 'l10n_source',
'transOrigDiffSourceField' => 'l18n_diffsource',
'languageField' => 'sys_language_uid',
'enablecolumns' => [
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => 'title',
],
'columns' => [
'image' => [
'exclude' => 1,
'label' => 'Bild',
'config' => [
'type' => 'inline',
'foreign_table' => 'sys_file_reference',
'foreign_field' => 'uid_foreign',
'foreign_sortby' => 'sorting_foreign',
'foreign_table_field' => 'tablenames',
'foreign_match_fields' => [
'fieldname' => 'inline_1',
],
'foreign_label' => 'uid_local',
'foreign_selector' => 'uid_local',
'overrideChildTca' => [
'columns' => [
'uid_local' => [
'config' => [
'appearance' => [
'elementBrowserType' => 'file',
'elementBrowserAllowed' => 'gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg',
],
],
],
'crop' => [
'description' => 'field description',
],
],
'types' => [
2 => [
'showitem' => '
--palette--;;imageoverlayPalette,
--palette--;;filePalette',
],
],
],
'filter' => [
[
'userFunc' => 'TYPO3\\CMS\\Core\\Resource\\Filter\\FileExtensionFilter->filterInlineChildren',
'parameters' => [
'allowedFileExtensions' => 'gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg',
'disallowedFileExtensions' => '',
],
],
],
'appearance' => [
'useSortable' => true,
'headerThumbnail' => [
'field' => 'uid_local',
'height' => '45m',
],
'enabledControls' => [
'info' => true,
'new' => false,
'dragdrop' => true,
'sort' => false,
'hide' => true,
'delete' => true,
],
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference',
],
],
],
],
'types' => [
'0' => [
'showitem' => 'image',
],
],
];
Files
Actions