Project

General

Profile

Actions

Bug #68504

closed

Extbase should support multiple setting in TCA

Added by Natalia Postnikova over 8 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-07-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #83433: selectMultipleSideBySide allow items mutiple timesNew2017-12-27

Actions
Actions #1

Updated by Susanne Moog over 8 years ago

  • Category set to Extbase
Actions #2

Updated by Anonymous over 7 years ago

Is there a workaround for this problem? Maybe create an additional model for the M:N table?

Actions #3

Updated by Stephan Bauer over 6 years ago

  • Related to Bug #83433: selectMultipleSideBySide allow items mutiple times added
Actions #4

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

Actions

Also available in: Atom PDF