Comments on: Improved Plugin for Model Validation: sfPropelValidatePlugin http://robrosenbaum.com/php/improved-plugin-for-model-validation-sfpropelvalidateplugin/ PHP, JavaScript, and Other Things Wed, 25 Feb 2009 11:43:00 +0000 hourly 1 http://wordpress.org/?v=3.3.1 By: Lucas http://robrosenbaum.com/php/improved-plugin-for-model-validation-sfpropelvalidateplugin/comment-page-1/#comment-73 Lucas Fri, 19 Oct 2007 14:06:30 +0000 http://robrosenbaum.com/symfony/improved-plugin-for-model-validation-sfpropelvalidateplugin/#comment-73 Hi Nice plugin, i just made some modifications. Using: if (!$article->save()) { $this->forward('patient', 'edit'); } sometimes does not returns true even if the validations succed, if you model has not been modified for ex, your post will always been forwarded. The solution i found was adding the following to sfValidateObjBuilder.php: $updated = ' if(!$this->isModified()) return true; '; $tmp = preg_replace('/(:save:pre.*?}.*?})/s', '\1'.$updated, $tmp, 1); Cheers L Hi Nice plugin, i just made some modifications.
Using:
if (!$article->save()) {
$this->forward(‘patient’, ‘edit’);
}
sometimes does not returns true even if the validations succed, if you model has not been modified for ex, your post will always been forwarded.

The solution i found was adding the following to sfValidateObjBuilder.php:

$updated = ‘
if(!$this->isModified()) return true;
‘;
$tmp = preg_replace(‘/(:save:pre.*?}.*?})/s’, ‘\1′.$updated, $tmp, 1);

Cheers L

]]>
By: rpsblog.com » A week of symfony #37 (10->16 September 2007) http://robrosenbaum.com/php/improved-plugin-for-model-validation-sfpropelvalidateplugin/comment-page-1/#comment-57 rpsblog.com » A week of symfony #37 (10->16 September 2007) Sun, 16 Sep 2007 22:52:42 +0000 http://robrosenbaum.com/symfony/improved-plugin-for-model-validation-sfpropelvalidateplugin/#comment-57 [...] Improved Plugin for Model Validation: sfPropelValidatePlugin [...] [...] Improved Plugin for Model Validation: sfPropelValidatePlugin [...]

]]>
By: Thierry Schellenbach http://robrosenbaum.com/php/improved-plugin-for-model-validation-sfpropelvalidateplugin/comment-page-1/#comment-51 Thierry Schellenbach Tue, 11 Sep 2007 11:32:19 +0000 http://robrosenbaum.com/symfony/improved-plugin-for-model-validation-sfpropelvalidateplugin/#comment-51 In fact I didn't look at builders yet. Could you post a tutorial? In fact I didn’t look at builders yet. Could you post a tutorial?

]]>