Review main Merged

27787[BUGFIX] Cannot use contain with multivalued static enumeration column

Xavier Perseguers CR +2 V +2 Easy +2 −0 updated 03/04/14, 17:16

Commit message

When a column is defined as a multivalued static enumeration:
'somecolumn' => array(
    'exclude' => 0,
    'label' => 'Some label',
    'config' => array(
        'type' => 'select',
        'items' => array(
            array('Option 1', 1),
            array('Option 2', 2),
            array('Option 3', 3),
            array('Option 4', 4),
        ),
        'size' => 4,
        'maxitems' => 4,
        'eval' => ''
    ),
),
it is not possible to query the domain model using operation "contains":
$value = 2;
$query->matching(
    $query->contains('somecolumn', $value)
);

Review

  • Code review CR +2
    • Markus Klein +2
    • Alexander Opitz +1
    • Wouter Wolters +1
    • Stefan Froemken +1
  • Verified V +2
    • Markus Klein +2
    • Stefan Froemken +1

Files 1

Review log 16

  1. Mr. Jenkins commented on patch set 1 02/22/14, 01:57

  2. Markus Klein voted on patch set 1 CR +1 02/22/14, 10:07

  3. Tomas Norre Mikkelsen voted on patch set 1 CR +1 02/28/14, 21:57

  4. Marc Bastian Heinrichs wrote 03/01/14, 09:28

    Topic set to "extbase".
  5. Marc Bastian Heinrichs commented on patch set 1 CR -1 03/01/14, 09:42

    Typo3DbBackend.php:626

    Quering a relation based on the type RELATION_NONE sounds not reasonable to me. Also I suspect that this would enable querying with contains on properties where this have not to be used and should not work. Also the principle of DRY is ignored here. I suggest to detect this type of relation as RELATION_HAS_MANY correct in the Datamapper.
  6. Xavier Perseguers uploaded patch set 2 03/01/14, 10:17

  7. Mr. Jenkins commented on patch set 2 03/01/14, 10:30

  8. Markus Klein updated the commit message in patch set 2 03/02/14, 18:13

  9. Markus Klein commented on patch set 3 CR +1 03/02/14, 18:14

    Just fixed the last paragraph of the commit message
  10. Mr. Jenkins commented on patch set 3 03/02/14, 18:38

  11. Alexander Opitz voted on patch set 3 CR +1 03/03/14, 14:08

  12. Wouter Wolters voted on patch set 3 CR +1 03/03/14, 18:58

  13. Stefan Froemken commented on patch set 3 V +1 CR +1 03/04/14, 08:58

    Tested with an extension i have programmed for this ticket. Works like expected.
  14. Markus Klein voted on patch set 3 V +2 CR +2 03/04/14, 16:11

  15. Markus Klein merged patch set 4 03/04/14, 16:11

  16. Marc Bastian Heinrichs commented on patch set 4 03/04/14, 17:16

    I suspect that this could cause a regression, when using such field in the order or on a childelement contains('somechild.somecolumn', $value), because Typo3DbBackend will add a join to the child table which is not there and will quite with a exception. Could somebody this check, please. thx