[pLog-svn] r3743 - plog/trunk/class/gallery/dao
Jon Daley
plogworld at jon.limedaley.com
Thu Jul 20 00:12:41 GMT 2006
This sounds like the sql error that has an empty owner_id.
I just grepped through the code, and I think that something is broken with
this function (and possibly other functions like getUserResources?) that
should be accepting a owner_id instead of a blog_id? The comments for
getUserResources says blog_id, but the code says owner_id...
I think the blog_id is being passed in most of the cases for
getNumUserResources.
Oscar - what should this be doing?
On Wed, 19 Jul 2006, oscar at devel.lifetype.net wrote:
> Author: oscar
> Date: 2006-07-19 21:11:53 +0000 (Wed, 19 Jul 2006)
> New Revision: 3743
>
> Modified:
> plog/trunk/class/gallery/dao/galleryresources.class.php
> Log:
> modified getNumUserResources so that no blog id needs to be provided (just leave it as '-1')
>
>
> Modified: plog/trunk/class/gallery/dao/galleryresources.class.php
> ===================================================================
> --- plog/trunk/class/gallery/dao/galleryresources.class.php 2006-07-19 21:11:11 UTC (rev 3742)
> +++ plog/trunk/class/gallery/dao/galleryresources.class.php 2006-07-19 21:11:53 UTC (rev 3743)
> @@ -255,7 +255,13 @@
> {
> $prefix = $this->getPrefix();
> $table = "{$prefix}gallery_resources";
> - $cond = "owner_id = '".Db::qstr( $ownerId )."'";
> +
> + $cond = "";
> + if( $ownerId != -1 )
> + $cond = "owner_id = '".Db::qstr( $ownerId )."'";
> + else
> + $cond = "owner_id = owner_id";
> +
> if( $albumId > GALLERY_NO_ALBUM )
> $cond .= "AND album_id = '".Db::qstr($albumId)."'";
> if( $resourceType > GALLERY_RESOURCE_ANY )
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>
--
Jon Daley
http://jon.limedaley.com/
We are all made different, but we are all sinners.
-- Jim Herron
More information about the pLog-svn
mailing list