Review main Merged

87441[BUGFIX] Ensure Indexed Search can handle PPTX and XLSX files

Benni Mack CR +2 V +2 Easy +36 −8 updated 12/19/24, 15:02

Commit message

Thanks to Xavier Perseguers for providing this fix
which properly indexes XLSX and PPTX files.

Problem for XLSX was that the wrong "unzipped" file was indexed,
a file that contains some kind of metadata which are basically only
pointers (integers). The content extracted is plain wrong and useless.

Problem for PPTX was that only the content of Slide 1 was extracted,
it missed content from all other slides.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1821

  1. Benni Mack uploaded patch set 1 12/11/24, 12:48

  2. core-ci voted on patch set 1 V +1 12/11/24, 12:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70929

  3. Xavier Perseguers voted on patch set 1 CR +1 12/11/24, 13:42

  4. Christian Kuhn voted on patch set 1 CR +1 V +1 12/17/24, 14:29

  5. Andreas Kienast voted on patch set 1 CR +1 12/17/24, 14:57

  6. Garvin Hicking commented on patch set 1 12/17/24, 22:03

    FileContentParser.php:536

    $cmd is not utilized anymore? utf8_content here can never be set to null due to the :string response, so I guess this line should be removed?
  7. Benni Mack commented on patch set 1 12/18/24, 06:47

    FileContentParser.php:536 Reply

    utf8_content is set to "null" if the file ending is e.g. docx or xlsx
  8. Garvin Hicking commented on patch set 1 12/18/24, 06:56

    FileContentParser.php:536 Reply

    but extractPptxContent cannot return null? and the other case has its own break&cmd
  9. Andreas Kienast commented on patch set 1 CR 0 12/18/24, 07:01

    FileContentParser.php:536 Reply

    Garvin is right. With `$utf8_content` never being null here as declared by `extractPptxContent()`, `$cmd` is not used in line 549.
  10. Benni Mack commented on patch set 1 12/18/24, 07:05

    FileContentParser.php:536 Reply

    yes. but the switch/case is in there as well.... so if the file ending is docx then $utf8_content is null, and we use the regular "extractContent" (which is CommandUtility::exec($cmd, $res); $content_xml = implode(LF, $res); unset($res); $utf8_content = trim(strip_tags(str_replace('<', ' <', $content_xml))); instead.
  11. Garvin Hicking commented on patch set 1 12/18/24, 07:16

    FileContentParser.php:536 Reply

    yes but the cmd used is the one in the docx switch, the potx switch cmd is never used again
  12. Benni Mack commented on patch set 1 12/18/24, 08:24

    FileContentParser.php:536 Reply

    ah, now i see! I wonder why phpstan does not find this...
  13. Benni Mack commented on patch set 2 CR +1 V +1 12/18/24, 08:25

    Published edit on patch set 1.
  14. Benni Mack commented on patch set 2 12/18/24, 08:25

    FileContentParser.php:536 Reply

    Done
  15. core-ci voted on patch set 2 V -1 12/18/24, 08:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71348

  16. Benni Mack commented on patch set 3 V -1 12/18/24, 11:06

    Published edit on patch set 2.
  17. core-ci voted on patch set 3 V +1 12/18/24, 11:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71369

  18. Garvin Hicking commented on patch set 3 CR +1 V +1 12/18/24, 12:58

    Thank you 😅
  19. Christian Kuhn voted on patch set 3 CR +1 V +1 12/19/24, 13:15

  20. Benni Mack voted on patch set 3 CR +2 V +2 12/19/24, 15:02

  21. Benni Mack merged patch set 4 12/19/24, 15:02