The inadvertent posting of an earlier draft when I posted this before
was unhelpful, so here is the same posting with the two missing
characters added (s/search/Ssearch/).
Again, the question is bug or luser error?
I'm reluctant to post on rt until I'm totally certain. I've pasted
in the rest of the code for added clarity.
I'm not 100% on this one, and I can't replicate the errors in my
application in the BeerDB yet, but this might be part of the story:
So Here's BeerDB.pm
------------------------------
package BeerDB;
use strict;
use warnings;
use Maypole::Application qw(-Debug) ;
# standard config stuff
BeerDB->config->{application_name}="BeerDB the Incremental Way";
BeerDB->config->uri_base("http://localhost/beer");
BeerDB->config->template_root("/usr/local/src/beer/templates/");
BeerDB->config->rows_per_page(10);
BeerDB->config->display_tables([qw[beer brewery pub style user]]);
BeerDB::Beer->require;
BeerDB->setup('dbi:mysql:beer', 'root', '');
# standard relationship stuff
BeerDB::Brewery->has_many(beers => "BeerDB::Beer");
BeerDB::Beer->has_a(brewery => "BeerDB::Brewery");
BeerDB::Style->has_many(beers => "BeerDB::Beer");
BeerDB::Beer->has_a(style => "BeerDB::Style");
BeerDB::Handpump->has_a(beer => "BeerDB::Beer");
BeerDB::Handpump->has_a(pub => "BeerDB::Pub");
BeerDB::Pub->has_many(beers => [ 'BeerDB::Handpump' => 'beer' ]);
BeerDB::Beer->has_many(pubs => [ 'BeerDB::Handpump' => 'pub' ]);
1;
and here's Beer.pm:
-----------------------------
package BeerDB::Beer;
use strict;
use warnings;
BeerDB::Beer->has_a(brewery => "BeerDB::Brewery");
BeerDB::Beer->has_a(style => "BeerDB::Style");
BeerDB::Beer::untaint_columns( printable => [qw /notes name url/],
integer => [qw /brewery style abc price score/],
);
}
sub Ssearch : Exported {
warn "search Over-ridden";
my ($self, $r) = @_;
$self->search($r);
# $self->SUPER::search($r) results in the same behaviour
}
1;
Now the symptom here is that I go to http://localhost/beer/beer/
Ssearch/?abv=22 and I get a 404 error
whereas
http://localhost/beer/beer/Ssearch/?
abv=22&brewery=&name=¬es=&price=&score=&style=&url=&search=search
works fine.
I'm happy that BeerDB::Beer is being called and setup (moved the
relationships into this file to demonstrate that).
Like I say, I'm not 100% confident that there isn't something silly
wrong with my code, but it seems to me that it's not working as
advertised.
So bug or luser error?
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users