#1317: Namespace org.agavi.controller.forwards.error_404 isn't populated if
routing fails to match
----------------------------------+-----------------------------------------
 Reporter:  m...@…                |        Owner:  david  
     Type:  defect                |       Status:  closed 
 Priority:  normal                |    Milestone:  1.0.4  
Component:  controller            |      Version:  1.0.3  
 Severity:  normal                |   Resolution:  wontfix
 Keywords:                        |    Has_patch:  0      
----------------------------------+-----------------------------------------
Changes (by david):

  * status:  new => closed
  * resolution:  => wontfix


Comment:

 Okay, I understand the issue now. What's happening is that
 {{{org.agavi.controller.forwards.error_404}}} is never filled if
 {{{AgaviRoutig::execute()}}} ultimately fails to match something useful.

 If, however, a 404 occurs because the given Action doesn't exist, the
 information is set when Agavi forwards to the 404 Action internally.

 Right now, I'd say that is expected behavior. The
 {{{org.agavi.controller.forwards.*}}} namespaces exist for the purpose of
 signaling to applications that Agavi performed an internal forward to
 another action (hence "org.agavi.'''controller'''.forwards") because some
 condition internal to the application caused it to do so (Action file is
 missing, module is disabled, ...). What happens here, though, is that no
 routes (or not enough routes) matched.

 In fact, the current behavior might be useful because it allows you to
 distinguish between invalid URLs (namespace not populated) and internal
 failures (e.g. one Action forwarding to another, non-existant Action).

 I'm marking this as ''wontfix'' for now, but feel free to discuss this
 here or on the users list. Do you have a specific use case where you can't
 determine why the 404 Action was invoked?

 P.S.: When reading this info in e.g. the 404 Action, you should use
 {{{
 
$this->getContainer()->hasAttributeNamespace('org.agavi.controller.forwards.error_404');
 }}}
 as this condition may occur more than once during a request dispatch, and
 it can obviously be in {{{$request}}} only once... so read from
 {{{$request}}} to be safe.

-- 
Ticket URL: <http://trac.agavi.org/ticket/1317#comment:5>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5



_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets

Reply via email to