Project

General

Profile

Actions

Bug #103777

closed

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

Added by Wolfgang Klinger 7 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2024-05-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

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)


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #101327: Harden FileInterface::getSize()ClosedAlexander Schnitzler2023-07-11

Actions
Has duplicate TYPO3 Core - Bug #103949: ProcessedFile::getSize returns 0ClosedGeorg Ringer2024-05-29

Actions
Actions #1

Updated by Oliver Hader 7 months ago

  • Category set to File Abstraction Layer (FAL)
  • Complexity changed from no-brainer to easy
Actions #2

Updated by Georg Ringer 7 months ago ยท Edited

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?

Actions #3

Updated by Georg Ringer 6 months ago

  • Has duplicate Bug #103949: ProcessedFile::getSize returns 0 added
Actions #4

Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84445

Actions #5

Updated by Gerrit Code Review 4 months ago

Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84445

Actions #6

Updated by Gerrit Code Review 4 months ago

Patch set 3 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84445

Actions #7

Updated by Christian Kuhn 4 months ago

  • Related to Task #101327: Harden FileInterface::getSize() added
Actions #8

Updated by Gerrit Code Review 4 months ago

Patch set 4 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84445

Actions #9

Updated by Georg Ringer 4 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benni Mack about 1 month ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF