[pLog-svn] r5256 - plog/branches/lifetype-1.2/class/gallery/dao
mark at devel.lifetype.net
mark at devel.lifetype.net
Mon Apr 2 14:01:03 EDT 2007
Author: mark
Date: 2007-04-02 14:01:03 -0400 (Mon, 02 Apr 2007)
New Revision: 5256
Modified:
plog/branches/lifetype-1.2/class/gallery/dao/galleryresources.class.php
Log:
We shouldn't update the counter If upload failed. Move those update counter code to the right place.
Modified: plog/branches/lifetype-1.2/class/gallery/dao/galleryresources.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/gallery/dao/galleryresources.class.php 2007-04-02 09:55:16 UTC (rev 5255)
+++ plog/branches/lifetype-1.2/class/gallery/dao/galleryresources.class.php 2007-04-02 18:01:03 UTC (rev 5256)
@@ -347,12 +347,6 @@
$this->Execute( $query );
}
- lt_include( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
- $albums = new GalleryAlbums();
- $album = $albums->getAlbum( $albumId );
- $album->setNumResources( $album->getNumResources() + 1 );
- $albums->updateAlbum( $album );
-
// clear our own caches
$this->_cache->removeData( $resourceId, CACHE_RESOURCES );
$this->_cache->removeData( $ownerId, CACHE_RESOURCES_USER );
@@ -476,6 +470,12 @@
$this->Execute( $query );
return $resFile;
}
+
+ lt_include( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
+ $albums = new GalleryAlbums();
+ $album = $albums->getAlbum( $albumId );
+ $album->setNumResources( $album->getNumResources() + 1 );
+ $albums->updateAlbum( $album );
// and finally, we can generate the thumbnail only if the file is an image, of course :)
if( $resourceType == GALLERY_RESOURCE_IMAGE ) {
More information about the pLog-svn
mailing list