You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ composer show --latest 'doctrine/*'
Direct dependencies required in composer.json:
doctrine/annotations 1.14.3 2.0.1 Docblock Annotations Parser
doctrine/doctrine-bundle 2.10.0 2.10.1 Symfony DoctrineBundle
doctrine/doctrine-migrations-bundle 3.2.4 3.2.4 Symfony DoctrineMigrationsBundle
doctrine/orm 2.15.2 2.15.3 Object-Relational-Mapper for PHP
Transitive dependencies not required in composer.json:
doctrine/cache 2.2.0 2.2.0 PHP Doctrine Cache library is a popular cache implementation that ...
doctrine/collections 2.1.2 2.1.2 PHP Doctrine Collections library that adds additional functionalit...
doctrine/common 3.4.3 3.4.3 PHP Doctrine Common project is a library that provides additional ...
doctrine/data-fixtures 1.6.6 1.6.6 Data Fixtures for all Doctrine Object Managers
doctrine/dbal 3.6.3 3.6.4 Powerful PHP database abstraction layer (DBAL) with many features ...
doctrine/deprecations v1.1.1 v1.1.1 A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 ...
doctrine/event-manager 2.0.0 2.0.0 The Doctrine Event Manager is a simple PHP event system that was b...
doctrine/inflector 2.0.6 2.0.8 PHP Doctrine Inflector is a small library that can perform string ...
doctrine/instantiator 2.0.0 2.0.0 A small, lightweight utility to instantiate objects in PHP without...
doctrine/lexer 2.1.0 3.0.0 PHP Doctrine Lexer parser library that can be used in Top-Down, Re...
doctrine/migrations 3.6.0 3.6.0 PHP Doctrine Migrations project offer additional functionality on ...
doctrine/persistence 3.2.0 3.2.0 The Doctrine Persistence project is a set of shared interfaces and...
doctrine/sql-formatter 1.1.3 1.1.3 a PHP SQL highlighting library
PHP version
$ php -v
PHP 8.2.8 (cli) (built: Jul 10 2023 22:24:17) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.8, Copyright (c) Zend Technologies
with Zend OPcache v8.2.8, Copyright (c), by Zend Technologies
with Xdebug v3.2.2, Copyright (c) 2002-2023, by Derick Rethans
Subject
I'm trying to use the closure strategy on multiple entities, and Closure.php inserts closures before all the entities have been persisted, which results in an attempt to insert null values into the closure table's ancestor and descendant columns.
Steps to reproduce
Create two entities that use the closure tree strategy (entity1 and entity2)
Use hautelook/alice-bundle to insert fixtures. Add fixtures with one root node for each type of entity.
Load the fixtures.
Expected results
Two rows should be added to the closure table, one for each entity fixture, with the ancestor and descendant columns containing the id for each fixture.
Actual results
Both types of fixtures will be loaded. In Closure.php, processPrePersist will queue up the child node inserts (in pendingChildNodeInserts). When when the fixture for entity1 is persisted, the processPostPersist method of Closure.php will attempt to insert closures for both the entity1 and entity2 fixtures, but the entity2 fixture hasn't been persisted yet. It will loop through pendingChildNodeInserts, and when it gets to the fixture for entity2, the nodeId will be null.
The output is as follows:
In ExceptionConverter.php line 47:
An exception occurred while executing a query: SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column
"ancestor" of relation "gf_group_criteria_closure" violates not-null constraint
DETAIL: Failing row contains (1, null, null, 0).
In Exception.php line 28:
SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "ancestor" of relation "gf_group_criteria_closu
re" violates not-null constraint
DETAIL: Failing row contains (1, null, null, 0).
In Statement.php line 121:
SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "ancestor" of relation "gf_group_criteria_closu
re" violates not-null constraint
DETAIL: Failing row contains (1, null, null, 0).
The text was updated successfully, but these errors were encountered:
JDruery
added a commit
to JDruery/DoctrineExtensions
that referenced
this issue
Jul 24, 2023
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Environment
Package
show
Doctrine packages
show
PHP version
Subject
I'm trying to use the closure strategy on multiple entities, and Closure.php inserts closures before all the entities have been persisted, which results in an attempt to insert null values into the closure table's ancestor and descendant columns.
Steps to reproduce
Expected results
Two rows should be added to the closure table, one for each entity fixture, with the ancestor and descendant columns containing the id for each fixture.
Actual results
Both types of fixtures will be loaded. In Closure.php, processPrePersist will queue up the child node inserts (in pendingChildNodeInserts). When when the fixture for entity1 is persisted, the processPostPersist method of Closure.php will attempt to insert closures for both the entity1 and entity2 fixtures, but the entity2 fixture hasn't been persisted yet. It will loop through pendingChildNodeInserts, and when it gets to the fixture for entity2, the nodeId will be null.
The output is as follows:
The text was updated successfully, but these errors were encountered: