On Mar 2, 2009, at 2:41 PM, Michal Charemza wrote:
Ok. I fully apologise that I was indeed a bit lazy and did not take the time to explain fully. I should know better. I feel shame... Right. To reproduce. It's slightly different to me original situation, but I've tried to minimize the steps: - Install the Sample App From 1.0 Release - In the settings of the sample app activate the database <setting name="use_database">true</setting> in settings.xml - Change settings in databases.xml to the correct location/user/pass of database: <ae:configuration environment="development"> <databases default="pdo_mysql_main"> <database name="pdo_mysql_main" class="AgaviPdoDatabase"> <ae:parameter name="dsn">mysql:host=localhost;dbname=blog_dev</ ae:parameter> <ae:parameter name="username">USERNAME</ae:parameter> <ae:parameter name="password">PASSWORD</ae:parameter> </database> </databases> </ae:configuration> - Add to LoginError view: $vr = $this->container->getValidationManager()->getReport(); $us = $this->context->getUser(); $us->setAttribute('validationReport', $vr); At this stage no exception is thrown when the Login Error page is viewed. However, if just above the above code I add: $this->context->getDatabaseManager()->getDatabase()-getConnection('pdo_mysql_main');Then there is an exception when the Login Error view is called. I hope this explains things a bit better.
This should do.
This is a bit of a different situation, as the PDO object is not in a model. However, I am indeed not storing it anywhere. Not even in the local function, let alone in the validation report itself, and the exception still occurs.
Well, you sort of do. The ValidationReport knows about all incidents. The individual incidents know about the failed validators. The validators have a reference to the context. The context knows about the database manager and the database manager knows the connection. And you store the ValidationReport and then things break. Validation reports were never meant to be stored, sorry. We consider making them serializable, but no guaranties that it will happen, we need to think about all the implications before doing such a change.
However, as explained in the other mail - you really don't need to store the report.
cheers felix
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
