diff options
| author | Christian Fowler <spider@viovio.com> | 2007-09-21 01:08:20 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2007-09-21 01:08:20 +0000 |
| commit | 946ce83065b33fa428e4346c826db02a2a81d6bb (patch) | |
| tree | 7a83a6db9971226881ec2d2f5b85d688b9b09267 /FisheyeGallery.php | |
| parent | baf1924890590b4bfa0931fb68263e121b26f405 (diff) | |
| download | fisheye-946ce83065b33fa428e4346c826db02a2a81d6bb.tar.gz fisheye-946ce83065b33fa428e4346c826db02a2a81d6bb.tar.bz2 fisheye-946ce83065b33fa428e4346c826db02a2a81d6bb.zip | |
fix no recursive delete of images to use is_a instead of is_subclass_of
Diffstat (limited to 'FisheyeGallery.php')
| -rw-r--r-- | FisheyeGallery.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/FisheyeGallery.php b/FisheyeGallery.php index 09a7bfe..48533ad 100644 --- a/FisheyeGallery.php +++ b/FisheyeGallery.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_fisheye/FisheyeGallery.php,v 1.66 2007/09/15 06:18:04 spiderr Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_fisheye/FisheyeGallery.php,v 1.67 2007/09/21 01:08:20 spiderr Exp $ * @package fisheye */ @@ -466,18 +466,17 @@ class FisheyeGallery extends FisheyeBase { foreach( array_keys( $this->mItems ) as $key ) { if( $pRecursiveDelete ) { $this->mItems[$key]->expunge( $pRecursiveDelete ); - } elseif( is_subclass_of( $this->mItems[$key], 'FisheyeImage' ) ) { + } elseif( is_a( $this->mItems[$key], 'FisheyeImage' ) ) { $query = "SELECT COUNT(`item_content_id`) AS `other_gallery` FROM `".BIT_DB_PREFIX."fisheye_gallery_image_map` WHERE `item_content_id`=? AND `gallery_content_id`!=?"; - if( $rs = $this->mDb->query($query, array($this->mItems[$key]->mContentId, $this->mContentId ) ) ) { - if( empty( $rs->fields['other_gallery'] ) ) { - $this->mItems[$key]->expunge(); - } + if( !($inOtherGallery = $this->mDb->getOne($query, array($this->mItems[$key]->mContentId, $this->mContentId ) )) ) { + $this->mItems[$key]->expunge(); } } } } + $query = "DELETE FROM `".BIT_DB_PREFIX."fisheye_gallery_image_map` WHERE `gallery_content_id`=?"; $rs = $this->mDb->query($query, array( $this->mContentId ) ); $query = "DELETE FROM `".BIT_DB_PREFIX."fisheye_gallery_image_map` WHERE `item_content_id`=?"; |
