Issue Bug Closed

#105825Passing null to parameter #1 ($string) of type string is deprecated in ...FileList.php line 664

Alex Kellner 12/15/24, 12:46 updated 12/02/25, 14:27

Description

After updating TYPO3 to 12.4.23 we faced an issue in backend module filelist as admin when switching to “list view”.

Complete error message:

PHP Runtime Deprecation Notice: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /app/vendor/typo3/cms-filelist/Classes/FileList.php line 664

This may be related to the fact that the server cannot render PDF as images at the moment, but I’m not totally sure.

Reviews 1

History 810

  1. Georg Ringer commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2024-12-15T18:44:08+00:00" > 12/15/24, 18:44 </span>

    thanks for your report! can you please test if changing the code works for you

    return '<br><img src="' . htmlspecialchars($processedFile->getPublicUrl() ?? '') . '" ' .
                'width="' . htmlspecialchars((string)$processedFile->getProperty('width')) . '" ' .
                'height="' . htmlspecialchars((string)$processedFile->getProperty('height')) . '" ' .
                'title="' . htmlspecialchars((string)$resourceView->getName()) . '" ' .
                'loading="lazy" ' .
                'alt="" />';
  2. Garvin Hicking commented and changed category <span data-processor="relativetime" data-value="2024-12-16T07:23:54+00:00" > 12/16/24, 07:23 </span>

    (@just2b – I guess we would need to catch for “null” and not emit the whole in that case?)

  3. Alex Kellner commented <span data-processor="relativetime" data-value="2024-12-16T08:19:19+00:00" > 12/16/24, 08:19 </span>

    I’m not able to test the changes from Georg because I don’t have write access to the server were this problem came up

  4. Marcus Schwemer commented <span data-processor="relativetime" data-value="2024-12-16T15:47:51+00:00" > 12/16/24, 15:47 </span>

    I was able to test it.

    The solution of Georg works.

    Thx. I will patch the core here for now.

    If there is something to review, I am happy to do that.

  5. Gerrit Code Review pushed patch set 1 for 12.4 to change 87535 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2024-12-17T14:23:46+00:00" > 12/17/24, 14:23 </span>

  6. Oliver Bartsch commented <span data-processor="relativetime" data-value="2024-12-17T14:26:10+00:00" > 12/17/24, 14:26 </span>

    Hi,

    thanks for reporting. This has already been fixed with #82855 in main and v13 with. I’ve now partially backported this to v12. You can test this https://review.typo3.org/c/Packages/TYPO3.CMS/+/87535.

    Best, Oli

  7. Oliver Bartsch commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2024-12-17T15:50:09+00:00" > 12/17/24, 15:50 </span>

    Applied in changeset commit:48bc267af9b38468ba14fbf0aa6859e6e40003d4.