Author: Jonathan.Wage
Date: 2010-01-12 21:31:06 +0100 (Tue, 12 Jan 2010)
New Revision: 26547
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/model/types/sfSympalAssetImageObject.class.php
Log:
[1.4][sfSympalPlugin][1.0] Fixing thumbnail generation so it is not called
unless the record is actually inserted or updated
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/model/types/sfSympalAssetImageObject.class.php
===================================================================
---
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/model/types/sfSympalAssetImageObject.class.php
2010-01-12 19:23:05 UTC (rev 26546)
+++
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/model/types/sfSympalAssetImageObject.class.php
2010-01-12 20:31:06 UTC (rev 26547)
@@ -113,6 +113,11 @@
private function _generateThumbnail()
{
+ if (!sfSympalConfig::get('assets', 'thumbnails_enabled', false))
+ {
+ return;
+ }
+
if (!class_exists('sfImage'))
{
throw new sfException('sfImageTransformPlugin must be installed in order
to generate thumbnails.');
@@ -138,13 +143,13 @@
}
}
- public function save()
+ public function postInsert(sfEvent $event)
{
- if (sfSympalConfig::get('assets', 'thumbnails_enabled', false))
- {
- $this->_generateThumbnail();
- }
+ $this->_generateThumbnail();
+ }
- return parent::save();
+ public function postUpdate(sfEvent $event)
+ {
+ $this->_generateThumbnail();
}
}
\ No newline at end of file
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.