Bug #68504
closedExtbase should support multiple setting in TCA
0%
Description
In TCA is is possible to configure a field that the same objekt can be referenced more than once. This settings is called "multiple" and is documented here:
http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Select/Index.html#multiple
Extbase does not support this feature (yet).
TCA configuration:
'products' => array( 'exclude' => 1, 'label' => 'LLL:EXT:myext/Resources/Private/Language/locallang_db.xlf:tx_myext_domain_model_product.products', 'config' => array( 'type' => 'select', 'foreign_table' => 'tx_myext_domain_model_product', 'MM' => 'tx_myext_order_product_mm', 'size' => 10, 'autoSizeMax' => 30, 'maxitems' => 9999, 'multiple' => 1 ) )
In BE it is possible to put the same item in the list for example three times.
In FE there will be only one item in the list.
Updated by Anonymous over 7 years ago
Is there a workaround for this problem? Maybe create an additional model for the M:N table?
Updated by Stephan Bauer over 6 years ago
- Related to Bug #83433: selectMultipleSideBySide allow items mutiple times added
Updated by Stefan Froemken 10 months ago
- Status changed from New to Closed
Hello,
thank you for reporting that issue.
Because of ram usage, extbase explicit tries to prevent duplicate objects with same UID in its session object and also in ObjectStorages.
I prefer following approach:
... protected DataMapper $dataMapper; ... public function injectDataMapper(DataMapper $dataMapper): void { $this->dataMapper = $dataMapper; } ... public function getMultipleRecords() { ... $records = $query->matching(...)->execute(true); return $this->dataMapper->map(MyModel::class, $records); }
I will close the ticket now. If you feel this is the wrong decision, let me know, and I will re-open it.
Stefan