-
-
Notifications
You must be signed in to change notification settings - Fork 190
Description
I was debugging an odd ORM in Neos which stated: The object of type "Neos\ContentRepository\Domain\Model\Workspace" (identifier: "user-admin") which was passed to EntityManager->add() is not a new object.
When looking at the Neos code it becomes imminent that there is some cyclic dependencies involved and we used a repository in an entity which can be implemented better: neos/neos-development-collection#5645
But also a ./flow flow:cache:flush --force helped the problem. So there must be a cache hickup. I was testing and operating on Neos and Flow 8.4 - which uses the new proxybuilding - and as far as i know didnt switch to the 8.3 branch. Now at some point locally my tests started failing.
The analysis of the full comparison of Flow_Reflection_RuntimeClassSchemata Flow_Reflection_RuntimeData and Flow_Object_Classes as well as the Doctrine-proxies shows that both testing context used Flow 8.4 proxybuilding with no abbreviations in the models and repositories especially for the Neos Workspace. Also the Flow_Reflection_RuntimeData was almost the same with some abbreviations in other places because the one context did not re-reflect upon new changes.
In Flow_Reflection_RuntimeClassSchemata i found that the Workspace and Site model from Neos had no repositoryClassName set (it was set to N meaning null. In the working testing context it was correctly set to ["repositoryClassName":protected]=> string(60) "Neos\ContentRepository\Domain\Repository\WorkspaceRepository": -> otherwise no differences.
Full ClassSchema dump of Workspace
object(Neos\Flow\Reflection\ClassSchema)#2 (6) {
["className":protected]=>
string(45) "Neos\ContentRepository\Domain\Model\Workspace"
["modelType":protected]=>
int(1)
["lazyLoadable":protected]=>
bool(false)
["repositoryClassName":protected]=>
NULL
["properties":protected]=>
array(6) {
["name"]=>
array(5) {
["type"]=>
string(6) "string"
["elementType"]=>
NULL
["nullable"]=>
bool(false)
["lazy"]=>
bool(false)
["transient"]=>
bool(false)
}
["title"]=>
array(5) {
["type"]=>
string(6) "string"
["elementType"]=>
NULL
["nullable"]=>
bool(false)
["lazy"]=>
bool(false)
["transient"]=>
bool(false)
}
["description"]=>
array(5) {
["type"]=>
string(6) "string"
["elementType"]=>
NULL
["nullable"]=>
bool(false)
["lazy"]=>
bool(false)
["transient"]=>
bool(false)
}
["owner"]=>
array(5) {
["type"]=>
string(6) "string"
["elementType"]=>
NULL
["nullable"]=>
bool(false)
["lazy"]=>
bool(false)
["transient"]=>
bool(false)
}
["baseWorkspace"]=>
array(5) {
["type"]=>
string(45) "Neos\ContentRepository\Domain\Model\Workspace"
["elementType"]=>
NULL
["nullable"]=>
bool(false)
["lazy"]=>
bool(false)
["transient"]=>
bool(false)
}
["rootNodeData"]=>
array(5) {
["type"]=>
string(44) "Neos\ContentRepository\Domain\Model\NodeData"
["elementType"]=>
NULL
["nullable"]=>
bool(false)
["lazy"]=>
bool(false)
["transient"]=>
bool(false)
}
}
["identityProperties":protected]=>
array(1) {
["name"]=>
string(6) "string"
}
}
Interestingly a few other entities were affected by exactly the same hickup - they all lacked only their repositoryClassName:
- (Neos_ContentRepository_Domain_Model_Workspace)
- Neos_Media_Domain_Model_ImportedAsset
- Neos_Neos_Domain_Model_Site
- Neos_Neos_EventLog_Domain_Model_Event
- Neos_Neos_EventLog_Domain_Model_NodeEvent
Now the last bigger refactoring was #3443 and previously the full proxy rebuilding. It could be some odd ordering issue when the Workspace is reflected but not its repository? But then again all other entities worked and even if i did switch branches i surely did not delete these 5 repositories at some point. (If this is because i switched to Neos 9.0 many more entities should be broken like NodeData etc. and in Neos 9.0 the Site continues to exist ...)