forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: Flaunt on May 25, 2006, 12:01:37 am

Title: Problem with Category Random Images and Latest Images
Post by: Flaunt on May 25, 2006, 12:01:37 am
When you click a category, there are spaces for random images from that category and the latest additions to that category and its subcategories.  Scroll to the latest additions.  The pictures appearing there are not just for the category but for the whole gallery itself.

second thing is the random pictures in a category.  Some pictures are also lost and when you click a thumbnail, it doesn't take you to its picture page but to an error page.  The error it gave out was:

Quote
The selected album/file does not exist !

File: /home/melissa/public_html/displayimage.php - Line: 266

Test Account:

Username: test
password: cattle
Title: Re: Problem with Category Random Images and Latest Images
Post by: Joachim Müller on May 25, 2006, 07:16:05 am
A test user account is much more helpful if it goes with a link to the page in question ::)
Preferably, a deep link to the page that shows the error message.
Title: Re: Problem with Category Random Images and Latest Images
Post by: Flaunt on May 25, 2006, 07:34:18 am
http://avril-images.net/index.php?cat=2 (http://avril-images.net/index.php?cat=2)

Click any of the random pictures at the bottom.  It'll take you to the error specified above.

And the pictures in the latest additions, which should feature only pictures from the category, features the latest features for the whole gallery.  click one and you'll see they don't belong to appearances at all

Title: Re: Problem with Category Random Images and Latest Images
Post by: Joachim Müller on May 25, 2006, 08:14:29 am
do you have any mods applied?
Title: Re: Problem with Category Random Images and Latest Images
Post by: Flaunt on May 25, 2006, 08:33:30 am
Nope, just the basic 1.4.6 install
Title: Re: Problem with Category Random Images and Latest Images
Post by: reficul on May 25, 2006, 07:29:56 pm
Quote
In category and its subcategories.  Scroll to the latest additions.  The pictures appearing there are not just for the category but for the whole gallery itself.

I've this problem too... after I upgrade from 1.4.1 to 1.4.6

My link
http://gallery.lamoneta.it/
Title: Re: Problem with Category Random Images and Latest Images
Post by: Flaunt on May 26, 2006, 01:49:38 am
Your forum works fine now.  :) What did you do?
Title: Re: Problem with Category Random Images and Latest Images
Post by: Paver on May 26, 2006, 02:14:57 am
@wacky_lokpo: You have debug_info visible which is helpful, and I can see that at the end of that debug_info that the $META_ALBUM_SET is empty.  That's the problem.  Why it's not set is not immediately clear to me.   I've seen this happen on my testbed once but I forget why and right now, I cannot replicate the problem (i.e. it's working fine).  I believe it happened when I was developing a plugin that messed with $META_ALBUM_SET so that would be "normal" (while I'm messing with things).

Do you have any plugins installed?

@reficul: I see on your site the same problem.  Do you have any mods or plugins installed?  Check your debug_info, at the end, see what's shown for "META SET".
Title: Re: Problem with Category Random Images and Latest Images
Post by: Flaunt on May 26, 2006, 03:07:51 am
No plugins are installed.  It's just a simple install :)
Title: Re: Problem with Category Random Images and Latest Images
Post by: reficul on May 26, 2006, 06:22:34 pm
In debug meta set are empty

Quote
Album set : AND aid IN (63,13,16,23,93,94,212,304,339,340,341,342,343,344,345) ; Meta set: ;
Title: Re: Problem with Category Random Images and Latest Images
Post by: Paver on May 26, 2006, 06:42:02 pm
So the problem is clearly that $META_ALBUM_SET is empty for both your sites.  This variable is used by those 2 blocks to filter out the albums in the current category.  It should be set for the albums in the current category.

@wacky_lokpo & @reficul:
If you have no mods or plugins installed, the only other thing I can suggest is your theme.php.  But I just tried ?theme=classic on both your sites and the problem still exists.  So that's not it.

I noticed when wacky_lokpo had the debug_info on that wacky_lokpo is coming from an upgrade from 1.3. 
@reficul: Are you coming from an upgrade as well?  I have no idea why that would matter, but might as well ask to try to find the commonality between your two sites.

I guess there must be a setting on the config panel that you both have different from my testbed config panel that somehow affects $META_ALBUM_SET. 

I don't have anything else to suggest right now.  Maybe another supporter will think of something.  I'll look into it some more when I have time.
Title: Re: Problem with Category Random Images and Latest Images
Post by: reficul on May 26, 2006, 09:32:49 pm
Quote
@reficul: Are you coming from an upgrade as well? 

yes from 1.4.1 to 1.4.6
Title: Re: Problem with Category Random Images and Latest Images
Post by: Paver on May 26, 2006, 09:38:52 pm
Aha!  This doesn't help you, but I have found where I saw the empty $META_ALBUM_SET problem - in my testbed for Coppermine 1.5 (the devel branch on Subversion).  I have no plugins installed but I might have some mods I'm working on.  I'll check it out - it may be related, but I cannot see how since my 1.4.6 testbed is working fine.

If either of you wants a quick band-aid, I could look into a theme or plugin quick-fix.
Title: Re: Problem with Category Random Images and Latest Images
Post by: Flaunt on May 27, 2006, 12:37:39 am
Please! We would really appreciate it  ;D
Title: Re: Problem with Category Random Images and Latest Images
Post by: Joachim Müller on May 27, 2006, 12:47:11 am
moving to bugs board.
Title: Re: Problem with Category Random Images and Latest Images
Post by: reficul on May 27, 2006, 09:22:25 am
thx Paver, what u need for a quick band-id? :)
Title: Re: Problem with Category Random Images and Latest Images
Post by: Paver on May 27, 2006, 12:53:16 pm
Never mind the band-aid, how about a fix?   :D

I think this will do it.  The difference between my 1.5 testbed and my 1.4 testbed was a config setting "Show private icon to unlogged user".  With this setting set to "Yes", the problem occurs on both testbeds.

Look for this line in functions.inc.php in the function get_meta_album_set($cat, &$meta_album_set):
Code: [Select]
if ($cpg_show_private_album || $USER_DATA['can_see_all_albums'] && $cat == 0) {

Add in an extra set of parentheses as shown:
Code: [Select]
INCORRECT CODE REMOVED
Correct Code:
Remove $cpg_show_private_album as shown:
Code: [Select]
if ($USER_DATA['can_see_all_albums'] && $cat == 0) {

And that should fix the bug, which it is.

edit: Code above changed due to the original fix being incorrect.  Please apply the correct fix to avoid this bug: http://forum.coppermine-gallery.net/index.php?topic=32091.0 (http://forum.coppermine-gallery.net/index.php?topic=32091.0)
Title: Re: Problem with Category Random Images and Latest Images
Post by: Flaunt on May 27, 2006, 01:20:00 pm
It worked! :)  The 2 errors are now absent :)  Thanks, Paver!
Title: Re: Problem with Category Random Images and Latest Images
Post by: reficul on May 28, 2006, 09:43:55 am
Thx paver. The fix work!
:)
Title: Re: Problem with Category Random Images and Latest Images
Post by: Sponge on May 29, 2006, 03:01:45 pm
I just wanted to say thank you for the fix too.

Everything seemed to be working fine until yesterday when I started getting the same error selecting random photographs from the random files catalogue. A bit of time spent using the search button brought me here. It now seems to be fixed.

So, thank you.

PS I love the software!  :D
Title: Re: Problem with Category Random Images and Latest Images
Post by: Paver on June 04, 2006, 10:31:53 pm
IMPORTANT: The code fix I originally posted above is incorrect - it leaves in a bug mentioned in this thread (http://forum.coppermine-gallery.net/index.php?topic=32091.0).

Scroll up or click here for the new fix: http://forum.coppermine-gallery.net/index.php?topic=31856.msg148155#msg148155 (http://forum.coppermine-gallery.net/index.php?topic=31856.msg148155#msg148155).

Essentially, you need to remove $cpg_show_private_album from the function get_meta_album_set() in functions.inc.php.  This is very important to keep your private photos from showing up in the random or latest images.
Title: Re: Problem with Category Random Images and Latest Images
Post by: Paver on June 04, 2006, 11:25:56 pm
Fix committed to stable & devel.  Will show up in the next version: 1.4.7.
Title: Re: Problem with Category Random Images and Latest Images
Post by: Flaunt on June 05, 2006, 03:30:37 am
Fix applied, although I wasn't really having the problem that member is using :)  Still!   Thanks for the heads up
Title: Re: Problem with Category Random Images and Latest Images
Post by: blabla on June 05, 2006, 01:40:34 pm
This worked wonders!

Thank you!
Title: Re: Problem with Category Random Images and Latest Images
Post by: skidpics on March 21, 2007, 04:17:23 pm
Had the same problem, but fixed it.  Make sure for the rest of the users searching for a fix, that you do not have have Random Select v1.01 plugin installed, but not in use.  It will cause random pics to be shown under the categories from all albums, but will generate the The selected album/file does not exist ! error.. 

-- Skidpics

warning: skidpics.com contains adult content!
Title: Re: Problem with Category Random Images and Latest Images
Post by: Joachim Müller on March 21, 2007, 06:54:38 pm
This is the bugs board. This issue has long been fixed. Locking.