Bug #95819
closedExtbase does not support uninitialized domain object properties
100%
Description
As of PHP 7.4, object properties can be defined with a property type and without a default value. This means, the property is uninitialized and needs to be initialized (a value must be set) before it can be accessed.
Example:
class Foo {
protected string $string;
protected ObjectStorage $items;
public function __construct(string $string)
{
$this->string = $string;
$this->items = new ObjectStorage();
}
}
This is perfectly valid php code but as Extbase does not support detecting those properties, they are neither respected when saving an object to the database nor when reconstituting an object from a database row. Such properties then remain uninitialized and lead to fatal errors.
This is especially annoying when there is a desire to not set a default value like for ObjectStorages which have to be initialized with null although that is no desired state in any case:
class Foo {
protected string $string;
protected ?ObjectStorage $items = null;
public function __construct(string $string)
{
$this->string = $string;
$this->items = new ObjectStorage();
}
}
To mitigate that issue, Extbase needs to rely on Reflection instead of method get_object_vars();
Updated by Gerrit Code Review almost 3 years ago
- Status changed from New to Under Review
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review almost 3 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review almost 3 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review over 2 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review over 2 years ago
Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72526
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72536
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72537
Updated by Witali Rott over 2 years ago
Sorry for the amount of patch sets, my first steps on gerrit. But the last patch set solves the problem: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72537
Updated by Stefan Bürk over 2 years ago
Wiali Rott, please do not any multiple tries (patches) for the same issues. As you see above, there was already a patch for that issue. Even before you added your first patch/approach. And now you have added a second one.
First of, it's not good to have have multiple patches for the same issue. At least, you could have tried out the first approach and test/verify it.
And instead of adding another patch (your second), you could have changed your first one and pushed a second patchset. and not a new patch add all. Meaning, checkout the first one, change your code, ammend it and push it again. That's described in the contribution guide.
Otherwise, you may ask for help in #typo3-cms-coredev channel on slack if something is unclear.
Least but not last, both of your patches went "red" on Core CI testing, meaning that the automaticlly tests failed.
edit
Just saw, your first patch has been gone. Have you abandoned it ?
Have you seen the other patch (9 patchsets) before your first try ? => https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Witali Rott over 2 years ago
Sure i saw it, the first patch was one month ago, the last some days ago. With this bug is TYPO3 useless, i can't fixing all the extensions with empty model values. Therefore i make an clear patch that works.
I apologize once again for my several attempts with gerrit.
Updated by Gerrit Code Review over 2 years ago
Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review over 2 years ago
Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review over 2 years ago
Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review over 2 years ago
Patch set 13 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review over 2 years ago
Patch set 14 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review over 2 years ago
Patch set 15 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review over 2 years ago
Patch set 16 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review over 2 years ago
Patch set 17 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Sascha Egerer over 2 years ago
- Has duplicate Bug #97646: Extbase property mapper does not work with uninitialized properties added
Updated by Gerrit Code Review about 2 years ago
Patch set 18 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review about 2 years ago
Patch set 19 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review about 2 years ago
Patch set 20 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72005
Updated by Gerrit Code Review about 2 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75363
Updated by Anonymous about 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e92d3212e5990d525b71ac967445add7e994b8c1.
Updated by Gerrit Code Review about 2 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 10.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/+/75364
Updated by Anonymous about 2 years ago
- Status changed from Under Review to Resolved
Applied in changeset fe1ed973724a5e5e68430c77f698c0672d94f7e0.
Updated by Oliver Hader almost 2 years ago
- Related to Bug #98148: Extbase persistence erronously tries to persist unmapped private property added
Updated by Benni Mack almost 2 years ago
- Status changed from Resolved to Closed
Updated by Gerrit Code Review over 1 year ago
- Status changed from Closed to Under Review
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72537
Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72537
Updated by Gerrit Code Review over 1 year ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72537
Updated by Gerrit Code Review over 1 year ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72537
Updated by Gerrit Code Review over 1 year ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72537
Updated by Benni Mack about 1 year ago
- Status changed from Under Review to Closed
Updated by Tobi Ferger 10 months ago
- Related to Bug #102278: Missing default value for property Container.php:$prototypeObjectsWhichAreCurrentlyInstanciated will lead to #1546632293 RuntimeException in GenericObjectValidator.php added