Re: [Maypole] delete -> 404

From: Peter Speltz (peterspeltz at yahoo.com)
Date: Sun Jan 23 2005 - 17:57:03 GMT


--- Johan Lindstrom <johanl at DarSerMan.com> wrote:

> I downloaded Maypole 2.06 the other day and finished the installation of
> the BeerDB. But I think I'm not quite finished, because I get a weird error.
>
> I went with a MySQL database instead of SQLite in the example application,
> but I have that working and I don't think it's related to the problem I have.
>
> Most things work ok. I can add new breweries and beers etc (with some
> problems, I may return to that; it seems related to that untaint thing
> Jesse Sheidlower talked about).
>
> I can list breweries. The URL is now
> http://localhost/beerdb/brewery/list/
>
> But when I click "delete" for a brewery (this really happens for all
> tables), the url changes to
> http://localhost/beerdb/brewery/delete/6
> and the page says: q{Not Found
> The requested URL /beerdb/brewery/delete/6 was not found on this server.}
> and the Apache error log says:
> [Sun Jan 23 17:13:58 2005] [error] [client 127.0.0.1] File does not exist:
> C:/Dokument/Projekt/Dev/TestMaypole/apache/htdocs/beerdb, referer:
> http://localhost/beerdb/brewery/list/
> [Sun Jan 23 17:13:58 2005] [error] [client 127.0.0.1] File does not exist:
> C:/Dokument/Projekt/Dev/TestMaypole/apache/htdocs/beerdb
>
> I'm not very experienced with Apache, but it almost seems like Apache
> doesn't allow BeerDB.pm to handle the request.
>
> I have looked for the delete() method which is supposed to get invoked, and
> I found it in Maypole/Model/CDBI.pm . An added warn() in that method
> doesn't show up in the error log (maybe it doesn't work like that...)
>

I run into this sometimes. The delete method is definitely not getting called
if your warning isn't showing up. First turn on debugging : in your driver
(BeerDB.pm) make a sub:
sub debug {1};

or use the flag in use base Maypole::Application(DEBUG=>1) # check man for
syntax
Debugging should give you more idea where error is via errorl log warnings.

For me i've found this is caused by:

1) delete method not having the exported attribute.
2) user not having permission -- it should if you haven't changed
authentication yet.
3** ) Error before delete method gets called. this is usually a
 relationship error or database not in synch with cdbi classes ie column name
different, not there, etc that causes a require to halt before getting to the
delete method for example. This is by far most frustrating problem i have with
maypole error handling because you can break something by changing completely
unrelated code.

> Any idea what's going on here? Any thoughts on where I should start
> looking/adding tracer bullets?
>

After debugging is on you should get better idea what went astray. After
putting warn in method i'm calling, if your using all default stuff, i'm
guessing the problem is yoour relationship declarations in cdbi class or
database differing from declarations in cdbi class.

=====
pjs

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT