Issue Bug Closed

#103777\TYPO3\CMS\Core\Resource\AbstractFile::getSize returns null for files with a size of 0 byte

Wolfgang Klinger 05/02/24, 09:37 updated 10/15/24, 09:31

Description

\TYPO3\CMS\Core\Resource\AbstractFile::getSize
returns `null` (which leads to problems up in the chain of callers) even though the file is valid, and the file size is there, it’s just coincidentally 0 bytes (happens).
I see this as a bug.

        return $size ? (int)$size : null;

(check with `isset` should be a simple solution here)

Reviews 2

History 610

  1. Oliver Hader changed category Complexity no-brainer easy 05/02/24, 15:37

  2. Georg Ringer commented 05/03/24, 05:56

    FYI

    was a breaking change in v13, fine there already https://review.typo3.org/c/Packages/TYPO3.CMS/+/80002/4/typo3/sysext/core/Classes/Resource/AbstractFile.php

    wolfgang, wanna do a change for v12, not adding the return type but swiching to 0 instead of null?

  3. Georg Ringer changed Duplicated by #103949 05/29/24, 20:30

  4. Gerrit Code Review pushed patch set 1 for 12.4 to change 84445 status New Under Review 05/29/24, 20:57

  5. Gerrit Code Review pushed patch set 2 for 12.4 to change 84445 07/16/24, 12:26

  6. Gerrit Code Review pushed patch set 3 for 12.4 to change 84445 07/23/24, 11:38

  7. Christian Kuhn changed Related to #101327 07/24/24, 11:09

  8. Gerrit Code Review pushed patch set 4 for 12.4 to change 84445 07/24/24, 11:09

  9. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % 07/24/24, 12:25

    Applied in changeset commit:f778344689ab714a1d29a6ccb98d2b63c3648381.

  10. Benni Mack changed status Resolved Closed 10/15/24, 09:31