Review main Merged

61884[BUGFIX] Fix 'pidonly' check in backend search

Christian Eßl CR +2 V +2 Easy +4 −6 updated 10/23/19, 09:58

Commit message

The TCA setting 'pidonly', which is used to limit a field to be only
searched in the single page view in the list module, was broken and
didn't behave as described in the official TCA documentation.

First, the 'pidonly' setting is expected to be a boolean. However, the
'if' condition would fail for a boolean because the in_array() check in
the code was using strict type mode. Also, this check would never care
about the actual value of 'pidonly', only if it was set.

Second, you couldn't search for an integer value, while not using the
'pidonly' setting, at all.

This patch fixes this behaviour.

Review

  • Code review CR +2 Done
    • Daniel Goerz +2
    • Sascha Rademacher +1
    • Julian Geils +1
    • Jörg Bösche +1
    • Henning Liebe +1
    • Felix P. +1
  • Verified V +2 Done
    • Daniel Goerz +2
    • Sascha Rademacher +1
    • Jörg Bösche +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 1723

  1. Christian Eßl uploaded patch set 1 10/04/19, 13:31

  2. TYPO3com voted on patch set 1 V -1 10/04/19, 13:32 Completed build in 16s on Fri, 4 Oct, 01:32 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37046

  3. Christian Eßl uploaded patch set 2 10/04/19, 14:46

  4. TYPO3com voted on patch set 2 V -1 10/04/19, 14:56 Completed build in 09m 47s on Fri, 4 Oct, 02:56 PM Test Summary: 47758 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37049

  5. TYPO3com voted on patch set 2 V +1 10/04/19, 15:25 Completed build in 09m 30s on Fri, 4 Oct, 03:25 PM Test Summary: 47759 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37050

  6. Markus Klein commented on patch set 2 10/04/19, 15:52

    PageLayoutView.php:3440 Unresolved

    simplify this to if (!isset($fieldConfig['search']['pidonly']) || ($fieldConfig['search']['pidonly'] && $currentPid > 0)) {

    DatabaseRecordList.php:3280 Unresolved

    same here
  7. Markus Klein commented on patch set 3 10/04/19, 15:53

    Published edit on patch set 2.
  8. TYPO3com voted on patch set 3 V -1 10/04/19, 16:03 Completed build in 09m 30s on Fri, 4 Oct, 04:03 PM Test Summary: 47759 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37051

  9. TYPO3com voted on patch set 3 V +1 10/04/19, 19:53 Completed build in 4h 09m 42s on Fri, 4 Oct, 07:53 PM Test Summary: 47759 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37051

  10. Daniel Goerz voted on patch set 3 CR +1 10/06/19, 19:41

  11. Daniel Goerz updated the commit message in patch set 4 10/08/19, 07:44

  12. Daniel Goerz commented on patch set 4 CR +1 10/08/19, 07:45

    Would most likely not got into 8. If you really want it for 8, please check with Benni if this is considered a priority bugfix.
  13. Julian Geils voted on patch set 4 CR +1 10/08/19, 08:04

  14. TYPO3com voted on patch set 4 V +1 10/08/19, 08:10 Completed build in 21m 08s on Tue, 8 Oct, 08:10 AM Test Summary: 47719 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37129

  15. Sascha Rademacher voted on patch set 4 V +1 CR +1 10/08/19, 10:09

  16. Felix P. voted on patch set 4 CR +1 10/08/19, 10:32

  17. Henning Liebe voted on patch set 4 CR +1 10/08/19, 11:34

  18. Jörg Bösche voted on patch set 4 V +1 CR +1 10/08/19, 13:06

  19. Andreas Kienast commented on patch set 4 10/08/19, 14:30

    PageLayoutView.php:3440

    This could work as well: `($fieldConfig['search']['pidonly'] ?? false) && $currentPid > 0`
  20. Daniel Goerz commented on patch set 4 CR 0 10/08/19, 14:35

    PageLayoutView.php:3440 Reply

    Isn't this now changed behavior (besides the bug with in_array)? If 'pidonly' is not set, why do we add the constraint for it anyway? The only play where we do not add the constraint is on pid 0?
  21. Daniel Goerz commented on patch set 4 10/08/19, 14:35

    PageLayoutView.php:3440 Reply Unresolved

    *place
  22. Daniel Goerz voted on patch set 4 V +2 CR +2 10/23/19, 09:58

  23. Daniel Goerz merged patch set 5 10/23/19, 09:58