Review main Merged

87951[BUGFIX] Clarify searchable TCA fields

Benni Mack CR +2 V +2 Hard +361 −239 updated 02/12/25, 08:15

Commit message

LiveSearch and List modules' SearchTermRestriction components
for each area use a different (static) list of TCA
types which are "searchable".

This change clarifies the list to be built in the Schema API
without keeping a static list everywhere.

This also resolves inconsitency and properly
validates the given "searchFields" list.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Georg Ringer +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Georg Ringer +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 1

Files 35

Show 15 more files

Review log 3140

Show 1115 earlier messages
  1. Benni Mack uploaded patch set 1 01/31/25, 09:14

  2. core-ci voted on patch set 1 V +1 01/31/25, 09:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73247

  3. Benni Mack updated the commit message in patch set 2 V +1 01/31/25, 09:58

  4. core-ci voted on patch set 2 V +1 01/31/25, 10:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73251

  5. Daniel Windloff commented on patch set 2 01/31/25, 10:17

    The method DatabaseRecordList->isTextFieldType() could be replaced as well. I suggest a second method to carify the kind of the query (->eq / ->like) to take string / integer etc. comparions into account.

    CategoryFieldType.php:38

    false as return type would be more specific
  6. Benni Mack uploaded patch set 3 V +1 01/31/25, 10:40

  7. Benni Mack commented on patch set 3 01/31/25, 10:40

    Thanks for the feedback!

    CategoryFieldType.php:38 Reply

    Done
  8. core-ci voted on patch set 3 V +1 01/31/25, 10:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73252

  9. Oli Bartsch commented on patch set 3 01/31/25, 11:06

    NumberFieldType.php:32

    This should not always be true according to current state. It is never declared in the static list but always via a dedicated condition, e.g. `($fieldType === 'number' && ($fieldConfig['format'] ?? 'integer') === 'integer')`

    SelectRelationFieldType.php:52

    Why should this be true?

    SearchableSchemaFieldsCollector.php:44

    Can we just do an return array_filer on the getFields()? Setting the array key to the fieldname has IMO no effect.
  10. Christian Kuhn commented on patch set 3 01/31/25, 11:13

    NumberFieldType.php:32 Reply

    type number was only searchable if its int? how does that make sense?

    SearchableSchemaFieldsCollector.php:44 Reply

    i like foreach better, its easier to parse in my head. it has no overhead and array key is not assigned.
  11. Daniel Windloff commented on patch set 3 01/31/25, 11:48

    DatabaseRecordList.php:2581

    I suggest making this decision on comparison type an API.

    NumberFieldType.php:32 Reply

    That's what I refer to with the type of the comparison in the query. On strings it should be ->like, on int eq.
  12. Benni Mack commented on patch set 3 01/31/25, 13:57

    DatabaseRecordList.php:2581 Reply

    I don't know if we should fix this separately.

    NumberFieldType.php:32 Reply

    I don't know if we should fix this separately.

    SelectRelationFieldType.php:52 Reply

    yes. should be false
  13. Benni Mack commented on patch set 4 V +1 01/31/25, 13:57

    Published edit on patch set 3.
  14. core-ci voted on patch set 4 V +1 01/31/25, 14:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73271

  15. Benni Mack commented on patch set 4 01/31/25, 14:11

    SelectRelationFieldType.php:52 Reply

    Done
  1. Benni Mack uploaded patch set 5 V +1 01/31/25, 22:10

  2. Benni Mack commented on patch set 4 01/31/25, 22:11

    DatabaseRecordList.php:2581 Reply

    see below

    NumberFieldType.php:32 Reply

    This is weird, I suggest to fix it separately with a dedicated "bugfix" in this case for type=number. This patch thus makes a good pre-patch for such changes.

    SearchableSchemaFieldsCollector.php:44 Reply

    Acknowledged
  3. core-ci voted on patch set 5 V +1 01/31/25, 22:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73294

  4. Oli Bartsch uploaded patch set 6 V +1 02/03/25, 09:11

  5. Oli Bartsch voted on patch set 6 CR +1 V +1 02/03/25, 09:11

  6. core-ci voted on patch set 6 V -1 02/03/25, 09:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73366

  7. Benni Mack uploaded patch set 7 CR +1 V +1 02/03/25, 09:51

  8. core-ci voted on patch set 7 V +1 02/03/25, 09:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73371

  9. Daniel Windloff commented on patch set 7 02/03/25, 10:12

    SearchableSchemaFieldsCollector.php:41

    Filter fields for $field->isSearchable() should be added.

    SearchableSchemaFieldsCollector.php:48

    Feature: Strong default, if no search fields has been configured.
  10. Oli Bartsch commented on patch set 7 02/03/25, 11:28

    SearchableSchemaFieldsCollector.php:41 Reply

    @benni@typo3.org, If I understand it correctly, the idea is that this overrules the new implementation but will be deprecated / removed soon.

    SearchableSchemaFieldsCollector.php:48 Reply

    Could you please elaborate? I quite don't understand this feature request.
  11. Daniel Windloff commented on patch set 7 02/03/25, 15:46

    SearchableSchemaFieldsCollector.php:41 Reply

    For TCA types with isSearchable(): false are no results possible even if they are in the list of fields. Therefore, I would remove them here.

    SearchableSchemaFieldsCollector.php:48 Reply

    The previous code returns an empty FieldCollection, if no search fields have been configured. Now a set of meaningful fields is used. From my point of view, that change in behavior is more a feature (which I like, btw).
  12. Benni Mack commented on patch set 7 02/03/25, 15:58

    SearchableSchemaFieldsCollector.php:48 Reply

    That would have been my next step (v14 only, breaking change) -> remove "searchFields"
  13. Oli Bartsch uploaded patch set 8 V +1 02/03/25, 17:56

  14. core-ci voted on patch set 8 V -1 02/03/25, 18:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73434

  15. Oli Bartsch uploaded patch set 9 V -1 02/03/25, 18:33

  16. core-ci voted on patch set 9 V +1 02/03/25, 18:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73437

  17. Oli Bartsch voted on patch set 9 CR +1 V +1 02/03/25, 21:08

  18. Oli Bartsch commented on patch set 9 02/04/25, 12:11

    SearchableSchemaFieldsCollector.php:41 Reply

    Done

    SearchableSchemaFieldsCollector.php:48 Reply

    Done
  19. Georg Ringer voted on patch set 9 CR +1 V +1 02/04/25, 12:19

  20. Andreas Kienast voted on patch set 9 CR +1 V +1 02/04/25, 12:25

  21. Oli Bartsch voted on patch set 9 CR +2 V +2 02/04/25, 12:38

  22. Oli Bartsch merged patch set 10 02/04/25, 12:38

  23. Andreas Kienast commented on patch set 10 02/05/25, 06:28

    DatabaseRecordList.php:2621

    It looks like this removal causes failures in Postgres: https://git.typo3.org/typo3/CI/cms/-/jobs/4166480
  24. Stefan Bürk commented on patch set 10 02/05/25, 08:59

    DatabaseRecordList.php:2621 Reply

    I'd say it's not this place. Even that a like query is created, it contains a cast to text field for the column. The exception from the nightly and manualy showed, that it must be the change in the PageRecordProvider. Will have a look.
  25. Benni Mack commented on patch set 10 02/12/25, 08:15

    DatabaseRecordList.php:2621 Reply

    Done