Review main Merged

77390[BUGFIX] Change column metaphone to varchar

Stefan Froemken CR +2 V +2 Easy +1 −1 updated 07/06/23, 12:35

Commit message

In case of activated STRICT_TRANS_TABLES, better known as strict_mode,
the index_words record incl. metaphone can not be stored as a string
is provided, but an int is expected.
As various metaphone related methods in TYPO3 return a string
we change the DB type of column metaphone to varchar. We set
the length to 60 as it is the same we use in analyzeHeaderinfo().

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1216

  1. Stefan Froemken uploaded patch set 1 01/16/23, 10:53

  2. Stefan Froemken updated the commit message in patch set 2 01/16/23, 10:54

  3. core-ci voted on patch set 2 V +1 01/16/23, 11:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35844

  4. core-ci voted on patch set 1 V +1 01/16/23, 11:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35843

  5. Christian Kuhn commented on patch set 2 CR -1 01/17/23, 12:37

    i had a rough look at 'metaphone' to see if it does anything useful at all (the related code is essentially in 2004 kasper state without any changes). example setup: page 1, content element text "steph" page 2, content element text "stef" advanced search, search for "stef", match "sounds like" -> finds both pages. metaphone field in "indexed_words" *is* an int, and ints are stored in there. I don't understand the full code (yet), but it looks as if int is the correct db type and we should sanitize / cast the php side.
  6. Benni Mack updated the commit message in patch set 3 CR -1 V +1 05/03/23, 09:28

  7. Oliver Hader rebased onto patch set 4 05/03/23, 11:53

  8. core-ci voted on patch set 4 V +1 05/03/23, 12:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41518

  9. Stefan Froemken commented on patch set 4 05/22/23, 08:37

    Reply

    Confirmed. By default that field should be INT. In that case this line in Indexer.php should return 0 instead of an empty string: $metaphone = $this->enableMetaphoneSearch ? substr($this->metaphone($val, $this->storeMetaphoneInfoAsWords), 0, 60) : ''; There is an option in indexerConfig to activate $this->enableMetaphoneSearch. If that is activated it will break nearly everything: $this->metaphoneObj->metaphone() returns: string metaphone($word); returns: string That's why I thought setting metaphone to varchar is much easier.
  10. Benni Mack commented on patch set 4 07/05/23, 19:57

    I would like to abandon this change in favor of https://review.typo3.org/c/Packages/TYPO3.CMS/+/74688 which is more comprehensive
  11. Sybille Peters commented on patch set 4 07/06/23, 09:15

    74688 is more comprehensive but not planned to get backported. Also, the functional tests currently fail on 74688. But, I don't know if we can backport this with DB changes. It would be nice to get a fix for v12 and v11 as well even if it is just an intermediate one.
  12. Stefan Bürk rebased onto patch set 5 V +1 07/06/23, 11:45

  13. core-ci voted on patch set 5 V +1 07/06/23, 12:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43711

  14. Stefan Bürk voted on patch set 5 V +1 CR +1 07/06/23, 12:21

  15. Benni Mack commented on patch set 5 V +2 CR +2 07/06/23, 12:35

    Just re-tested. This DB change is an optional change and avoids exceptions with metaphone, let's get it in.
  16. Benni Mack merged patch set 6 07/06/23, 12:35