I honestly cannot see how Zend_Auth is the issue here.

To help debug the situation, you should try deleting the session files to ensure that your session is clean.

As for your exception message, that is a tough one. The exception (by looking at the youtube video) appears to say that the problem originated in the $em->flush() call inside your indexAction(). Unfortunately, that exception message that you got is probably best answered on the Doctrine mailing list, as it originates from their code.

Where do you think the stdClass being referred to is being generated from?

-ralph


jiewmeng wrote:
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)

Reply via email to