Gossamer Forum
Quote Reply
404 issue
Hi,

in addition to this post:
http://www.gossamer-threads.com//perl/gforum/gforum.cgi?post=295935#p295935
I stumbled over another 404 issue:

In Page.pm : sub generate_category_page
there are several checks for a valid category but it looks like a random number does not lead to a 404 error so I added:
Code:
$id = $cat_db->select(ID => GT::SQL::Condition->new("ID" => LIKE => $id))->fetchrow || undef;
before

Code:
# Check for valid sort order.
Maybe there s a more elegant way but at least it works.

Regards

n||i||k||o

Last edited by:

el noe: Jun 24, 2008, 3:20 PM
Quote Reply
Re: [el noe] 404 issue In reply to
It seems to do the right thing without that bit of code (at least in my copy).

What is the url you're using to generate the 404, and which revision of the module do you have (see the header of the file).

Adrian
Quote Reply
Re: [brewt] 404 issue In reply to
Hi Adrian,


looks like it was my mistake:

$Id: Page.pm,v 1.27 2006/08/23 22:21:52 brewt Exp $

works fine.

I am just a little bit worried because I have two revisions with the same date and version, one with:

Code:
# Now we get the ID number of the category based on the URL.
my $cat_db = $DB->table('Category');
my $id;
if ($CFG->{build_category_dynamic} eq 'ID' or $page =~ /^\d+$/) {
($id) = $page =~ /(\d+)$/;
}
else {
$id = $cat_db->select(ID => { ($CFG->{build_category_dynamic} || 'Full_Name') => $page })->fetchrow;
}

and one with

Code:
# Now we get the ID number of the category based on the URL.
my $cat_db = $DB->table('Category');
my $id;
if ($CFG->{build_category_dynamic} eq 'ID' or $page =~ /^\d+$/) {
($id) = $page =~ /(\d+)$/;
# Make sure the ID is valid
$id = $cat_db->select(ID => { ID => $id })->fetchrow;
}
else {
$id = $cat_db->select(ID => { ($CFG->{build_category_dynamic} || 'Full_Name') => $page })->fetchrow;
}

which obviously has the ID check. Maybe I messed something up Crazy.

Thank you for your feedback.

n||i||k||o
Code:
Quote Reply
Re: [el noe] 404 issue In reply to
That change was made in revision 1.31 of the file, so either I had previously given you that line of code or you got it from an update.

Adrian
Quote Reply
Re: [brewt] 404 issue In reply to
Hi Adrian,

then it was probably an update I did not make in one installation but the other.

Thank you again

n||i||k||o