Bug #32830

Validation on persist breaks with Doctrine Lazy Loading Proxies

Added by Sebastian Kurfuerst over 3 years ago. Updated over 3 years ago.

Status:Resolved Start date:2011-12-24
Priority:Should have Due date:
Assigned To:Sebastian Kurfuerst % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0.3
PHP Version: Complexity:
Has patch:No Affected Flow version:FLOW3 1.0.2

Description

Hey everybody,

I am currently experiencing an error with the Validate-On-Persist:

Fatal error: Call to a member function getClassName() on a non-object in /.../Data/Temporary/Development/Cache/Code/FLOW3_Object_Classes/TYPO3_FLOW3_Persistence_Doctrine_PersistenceManager_Original.php on line 112

The stack trace is attached.

After debugging a little deeper, it appears that this happens when a lazily-loaded entity is updated. In this case, the get_class($object) in ReflectionService returns something like "Doctrine\....Proxies\FooBarDomainModelBar" --> and obviously our Reflection Service cannot deal with this.


Related issues

related to TYPO3.Flow - Bug #31502: Validation during persistence got lost in Doctrine addition Resolved 2011-11-02

Associated revisions

Revision 2fdc342d
Added by Sebastian Kurfuerst over 3 years ago

[BUGFIX] Make updating a Doctrine Lazy Loading Proxy work

When a Doctrine lazy loading proxy is persisted again, a fatal error is thrown
because the Reflection Service cannot handle Doctrine Proxies.

We work around this issue by asking the Doctrine Entity Manager to resolve the
class name.

A Functional Test reproducing the issue is included.

Change-Id: I2d515dd450880e2fd8a6f6fab8d31720fc57ec07
Fixes: #32830
Releases: 1.0, 1.1

Revision d7af18a9
Added by Sebastian Kurfuerst over 3 years ago

[BUGFIX] Make updating a Doctrine Lazy Loading Proxy work

When a Doctrine lazy loading proxy is persisted again, a fatal error is thrown
because the Reflection Service cannot handle Doctrine Proxies.

We work around this issue by asking the Doctrine Entity Manager to resolve the
class name.

A Functional Test reproducing the issue is included.

Change-Id: Idb1fc3b797af7ed7f3bef7e19bdb786b47733899
Fixes: #32830
Releases: 1.0, 1.1

Revision 0736b6a4
Added by Sebastian Kurfuerst over 3 years ago

[BUGFIX] Fix FLOW3 1.0 Functional Tests

I introduced an error inside the functional tests in https://review.typo3.org/#change,7715
and this followup commit fixes it.

Related: #32830
Releases: 1.0
Change-Id: I526da99a99a1c9257e30a13f909a4824b11832b3

History

#1 Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7513

#2 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7513

#3 Updated by Karsten Dambekalns over 3 years ago

  • Affected Flow version changed from Git master to FLOW3 1.0.2

#4 Updated by Karsten Dambekalns over 3 years ago

  • Category set to Persistence
  • Assigned To set to Sebastian Kurfuerst
  • Target version set to 1.0.3

#5 Updated by Gerrit Code Review over 3 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7513

#6 Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch FLOW3-1.0 has been pushed to the review server.
It is available at http://review.typo3.org/7715

#7 Updated by Sebastian Kurfuerst over 3 years ago

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

Also available in: Atom PDF