i am having problems persisting a Doctrine 2 entity (Post) when the User is
logged in with Zend_Auth.

i am quite sure its the login as the code runs, when the user is logged out,
and fails once the user is logged in. and it seems that the identity
returned from the Zend_Auth::authenticate() plays a role in affecting the
error message.

ok my setup is as follows ...

a clean zend framework app generated with zend tool

- zend framework 1.10.7
- doctrine 2
-  http://pastebin.com/rzSzNDVS bootstrap.php  - bootstrapping doctrine
autoloaders, config & setup entity manager
-  http://pastebin.com/1F00Cw0q Application_Auth_Adapter  - simply returns a
very basic Zend_Auth_Result
-  http://pastebin.com/TgDRqzP7 IndexController 
      - indexAction - where i try to insert a new post
      - loginAction - where i login with Zend_Auth
      - logoutAction - where i logout
-  http://pastebin.com/9r0VB5eP Application\Models\Post  - the post model
class
-  http://pastebin.com/c4FRM0QK Application\Models\User  - the user model
class

when i return stdClass in authenticate() i will get an error message like

A new entity was found through a relationship that was not configured to
cascade persist operations: stdcl...@000000006ba9d6930000000007857036.
Explicitly persist the new entity or configure cascading persist operations
on the relationship.

return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, new StdClass); //
notice the error msg reflects the class returned as the identity (2nd)
parameter

when i return a string, the error i get,

A new entity was found through a relationship that was not configured to
cascade persist operations: @. Explicitly persist the new entity or
configure cascading persist operations on the relationship.

when i return a Application\Models\Post, i get

A new entity was found through a relationship that was not configured to
cascade persist operations:
application\models\u...@000000000aea1b5f0000000028c32e2c. Explicitly persist
the new entity or configure cascading persist operations on the
relationship.

how can i proceed from here? how do i debug this?

for those who like to see a video of it in action (the error), i have it on 
http://screenr.com/1U0 screenr  and 
http://www.youtube.com/watch?v=BeWKm74-4yM youtube  (with annotations)
-- 
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Errors-persisting-Doctrine-2-entity-once-user-is-logged-in-with-Zend-Auth-tp2325115p2325115.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to