Issue Bug Closed

#52919suggest wizard doesnt respect "uniqueness" in TCA type "select"

Michael Münch 10/17/13, 14:30 updated 09/02/18, 12:00

Description

if i’am using the “select” type in TCA with an m:n relation (double select box), i can only select each item once, this is the expected behaviour.

in combination with the “suggest wizard” i’am able to select an item already in the selected list, cause it seems there isnt any restriction for the wizard to not add already selected items.

Is this a bug or am i missing something in the configuration?

The TCA of the field:

'questions' => array(
    'exclude' => 0,
    'label' => 'LLL:EXT:tnm_quiz/Resources/Private/Language/locallang_db.xml:tx_tnmquiz_domain_model_questionnaire.questions',
    'config' => array(
        'type' => 'select',
        'foreign_table' => 'tx_tnmquiz_domain_model_question',
        'MM' => 'tx_tnmquiz_questionnaire_question_mm',
        'size' => 10,
        'autoSizeMax' => 30,
        'maxitems' => 9999,
        'wizards' => array(
            '_PADDING' => 1,
            '_VERTICAL' => 1,
            'edit' => array(
                'type' => 'popup',
                'title' => 'Edit',
                'script' => 'wizard_edit.php',
                'icon' => 'edit2.gif',
                'popup_onlyOpenIfSelected' => 1,
                'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
                ),
            'add' => Array(
                'type' => 'script',
                'title' => 'Create new',
                'icon' => 'add.gif',
                'params' => array(
                    'table' => 'tx_tnmquiz_domain_model_question',
                    'pid' => '###CURRENT_PID###',
                    'setValue' => 'prepend'
                    ),
                'script' => 'wizard_add.php',
            ),
            'suggest' => array(
                'type' => 'suggest'
            ),
        ),
    ),
),

Example:

It isnt a big problem in the given example, but there are cases with more than 50 questions .. and manually filter out duplicate items will be very strange

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.