Problem with Category Random Images and Latest Images Problem with Category Random Images and Latest Images
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Problem with Category Random Images and Latest Images

Started by Flaunt, May 25, 2006, 12:01:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Flaunt

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

Joachim Müller

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.

Flaunt

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


Joachim Müller


Flaunt


reficul

QuoteIn 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/

Flaunt


Paver

@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".

Flaunt

No plugins are installed.  It's just a simple install :)

reficul

In debug meta set are empty

QuoteAlbum set : AND aid IN (63,13,16,23,93,94,212,304,339,340,341,342,343,344,345) ; Meta set: ;

Paver

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.

reficul

Quote
@reficul: Are you coming from an upgrade as well? 

yes from 1.4.1 to 1.4.6

Paver

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.

Flaunt


Joachim Müller


reficul


Paver

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):
if ($cpg_show_private_album || $USER_DATA['can_see_all_albums'] && $cat == 0) {


Add in an extra set of parentheses as shown:
INCORRECT CODE REMOVED

Correct Code:
Remove $cpg_show_private_album as shown:
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

Flaunt

It worked! :)  The 2 errors are now absent :)  Thanks, Paver!

reficul


Sponge

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