94642[BUGFIX] Fix `Undefined property: stdClass::$name` PHP Warning
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Oliver Klee +1
- Garvin Hicking +1
- Andreas Kienast +1
- Benni Mack +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Garvin Hicking +1
- Andreas Kienast +1
- Benni Mack +1
- core-ci +1 CI
Issues 2
Files 1
Review log 2124
-
Benjamin Franzke uploaded patch set 1 07/01/26, 07:57
-
core-ci voted on patch set 1 V -1 07/01/26, 08:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104130
-
Benjamin Franzke uploaded patch set 2
V -107/01/26, 08:08 -
core-ci voted on patch set 2 V +1 07/01/26, 08:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104134
-
Helmut Hummel commented on patch set 2 CR -1 07/01/26, 09:07
trying to understand the issue at first -
Benni Mack voted on patch set 2 CR +1 V +1 07/01/26, 09:07
-
Benjamin Franzke commented on patch set 2 07/01/26, 09:15
Reply
`new \stdClass()` is assigned to `$composerManifest` and if the composer.json file does not exist, the object will be an empty object, therefore `$name` can not be accessed. (as mentioned in the commit message: happened when an active extension was removed but still referenced in PackageStates.php) -
Simon Schaufelberger voted on patch set 2 CR +1 V +1 07/01/26, 09:26
-
Helmut Hummel commented on patch set 2 07/01/26, 09:26
Reply
With removed you actually mean removing the files and folders without using the TYPO3 API (extension manager)? Doesn't this break a ton of other things as well? Or do you mean something different? -
Helmut Hummel commented on patch set 2 07/01/26, 09:32
PackageManager.php:923I would rather initialize with null herePackageManager.php:929and move this check outside the file_exists() condition, so that if no composer.json exists an exception is thrown upfrontPackageManager.php:938I think this is confusing to silently ignore the warning here -
Benjamin Franzke commented on patch set 2 07/01/26, 10:27
Reply
Yes, "from the file system", e.g. when switching away from (Feature) branches, that contain new extensions, they are usually "just" removed from PackageStates.php.PackageManager.php:929ReplyI tried that in https://review.typo3.org/c/Packages/TYPO3.CMS/+/94642/1 which resulting in "Extension "functional-a41b513" is missing a composer.json file!" to be thrown in functionals, possibly because it seemed also the project root is checked via this method as well: https://git.typo3.org/typo3/CI/cms/-/jobs/5711636PackageManager.php:938Replyhm, this does not ignore, but prevent the warning. But I agree that this code should ideally not try to real from that object at all, if it is known to be missing/incorrect. On the other hand, even an available `composer.json` could have been changed (since initial registration) and could therefore miss the `name` field. So at any point after parsing we need to check if the property exists. I'm not against doing that in a pre-check though. -
Simon Schaufelberger voted on patch set 2 CR 0 V 0 07/01/26, 10:32
-
Benni Mack commented on patch set 2 07/01/26, 11:58
Reply
this is how i tested it as well -
Helmut Hummel commented on patch set 2 CR 0 07/02/26, 06:38
Reply
AcknowledgedPackageManager.php:938Reply> But I agree that this code should ideally not try to real from that object at all, if it is known to be missing/incorrect. Let's get this fixed first and clean up later. Would you mind creating a todo comment reflecting this. Then this should be good to go. Thanks! -
Helmut Hummel commented on patch set 2 07/02/26, 06:38
PackageManager.php:923ReplyAcknowledgedPackageManager.php:929ReplyAcknowledged -
Benjamin Franzke uploaded patch set 3
CR +1V +107/03/26, 08:39 -
Benjamin Franzke commented on patch set 3 07/03/26, 08:39
PackageManager.php:938ReplyAck, done. Thanks! -
core-ci voted on patch set 3 V +1 07/03/26, 08:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104271
-
Benni Mack voted on patch set 3 CR +1 V +1 07/03/26, 09:31
-
Oliver Klee voted on patch set 3 CR +1 07/03/26, 10:06
-
Garvin Hicking voted on patch set 3 CR +1 V +1 07/03/26, 10:17
-
Benjamin Franzke voted on patch set 3 CR +2 V +2 07/03/26, 12:40
-
Andreas Kienast voted on patch set 3 CR +1 V +1 07/03/26, 12:40
-
Benjamin Franzke merged patch set 4 07/03/26, 12:40