[pLog-svn] r3371 - plog/trunk/class/gallery/dao
mark at devel.lifetype.net
mark at devel.lifetype.net
Tue May 9 15:56:07 GMT 2006
Author: mark
Date: 2006-05-09 15:56:06 +0000 (Tue, 09 May 2006)
New Revision: 3371
Modified:
plog/trunk/class/gallery/dao/galleryalbums.class.php
Log:
Fixed a bug that James talked to me in MSN.
When move the album to other place, we have to check it move to "root" album or not... becasue there is no counter of "root" album, and it will cause some error messages.
Modified: plog/trunk/class/gallery/dao/galleryalbums.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryalbums.class.php 2006-05-09 02:46:51 UTC (rev 3370)
+++ plog/trunk/class/gallery/dao/galleryalbums.class.php 2006-05-09 15:56:06 UTC (rev 3371)
@@ -258,13 +258,20 @@
if( $prevVersion->getParentId() != $album->getParentId()) {
// increase the counter of the new album
$parent = $album->getParent();
- $parent->setNumChildren( $parent->getNumChildren() + 1 );
+ if( $parent )
+ {
+ $parent->setNumChildren( $parent->getNumChildren() + 1 );
+ // update the objects
+ $this->updateAlbum( $parent );
+ }
// decrease the number of children in the previous parent
$prevParent = $prevVersion->getParent();
- $prevParent->setNumChildren( $prevParent->getNumChildren() - 1 );
- // update the objects
- $this->updateAlbum( $parent );
- $this->updateAlbum( $prevParent );
+ if( $prevParent )
+ {
+ $prevParent->setNumChildren( $prevParent->getNumChildren() - 1 );
+ // update the objects
+ $this->updateAlbum( $prevParent );
+ }
}
}
More information about the pLog-svn
mailing list