2009年11月15日星期日

Re: [fw-mvc] Chaining Hostname and REST Routes

bradley.holt wrote:
>
> Yeah, I've spent some time looking around between the various routes
> and I'm still not quite sure what the intended behavior is. It seems
> to be trying to iteratively reduce $subPath to an empty string and if,
> at the end, it isn't an empty string it considers the whole chain to
> not be a match. However, the setMatchedPath method never gets called
> in the REST router so getMatchedPath will always return null and
> therefore the Chain won't reduce $subPath. Looking at some other
> routes as examples, it appears that the setMatchedPath method is only
> called when the $partial parameter is true but I don't see any
> comments on what the $partial parameter is for but it defaults to
> false. From what I can tell, either the REST router is suppose to
> implement the $partial parameter and/or call setMatchedPath or the
> Chain is not correctly handling scenarios where getMatchedPath returns
> null. Or it's something else entirely :-)
>
> On Sat, Nov 14, 2009 at 7:32 PM, Kyle Spraggs <theman@spiffyjr.me> wrote:
>>
>>
>>
>> bradley.holt wrote:
>>>
>>> What I meant to say was, "that statement evaluates to *true* thus
>>> returning *false*."
>>>
>>> On Sat, Nov 14, 2009 at 7:21 PM, Bradley Holt
>>> <bradley.holt@foundline.com> wrote:
>>>> I tracked down the problem code, but I don't know enough about how
>>>> it's supposed to work to suggest a fix. The problem is with the
>>>> following code in Zend_Controller_Router_Route_Chain:
>>>>
>>>>        if ($subPath !== '' && $subPath !== false) {
>>>>            return false;
>>>>        }
>>>>
>>>> My $subPath variable has the value "checkout/order/some-id" so that
>>>> statement evaluates to false, ignoring the correct values it got from
>>>> my routes. I'm going to poke around some more to see if I can
>>>> understand how it's supposed to work and suggest a patch or
>>>> workaround.
>>>>
>>>> On Sat, Nov 14, 2009 at 7:06 PM, Bradley Holt
>>>> <bradley.holt@foundline.com> wrote:
>>>>> Kyle,
>>>>>
>>>>> I've been doing some debugging as well and the only difference I've
>>>>> found so far is that with a plain old REST route the pathInfo looks
>>>>> like this:
>>>>>
>>>>> /checkout/order/some-id
>>>>>
>>>>> and when chained with a Hostname route it looks like this (I'm
>>>>> guessing the beginning slash is getting removed by the Hostname
>>>>> route):
>>>>>
>>>>> checkout/order/some-id
>>>>>
>>>>> However, from what I've seen so far this should not make any
>>>>> difference at all. I'll keep digging...
>>>>>
>>>>> On Sat, Nov 14, 2009 at 7:00 PM, Kyle Spraggs <theman@spiffyjr.me>
>>>>> wrote:
>>>>>>
>>>>>> I literally just sent a message out pertaining to this exact thing.
>>>>>> I'm
>>>>>> unable to get it working and I've tried tracing the steps but I'm not
>>>>>> on my
>>>>>> home system with the Zend Server so debugging is less than ideal at
>>>>>> the
>>>>>> moment.
>>>>>>
>>>>>> Perhaps someone "in the know" will step up to the plate and answer
>>>>>> our
>>>>>> questions.
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/Chaining-Hostname-and-REST-Routes-tp26354930p26355129.html
>>>>>> Sent from the Zend MVC mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Bradley Holt
>>>>> bradley.holt@foundline.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Bradley Holt
>>>> bradley.holt@foundline.com
>>>>
>>>
>>>
>>>
>>> --
>>> Bradley Holt
>>> bradley.holt@foundline.com
>>>
>>>
>>
>> I recently found the same thing and I'm unsure of a fix at this point. I
>> can
>> verify that each route is returning the proper module, controller, and
>> array
>> but breaks after chaining.
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Chaining-Hostname-and-REST-Routes-tp26354930p26355316.html
>> Sent from the Zend MVC mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Bradley Holt
> bradley.holt@foundline.com
>
>

Have you looked at http://framework.zend.com/issues/browse/ZF-7928? This
issue is similar to what you are showing but was slated as fixed in 1.9.4.
I'm using ZF 1.9.5 and I'm still unable to get chaining to work. I'm curious
if you're using the latest Zend version and if I'm not configuring my chain
correctly.
--
View this message in context: http://old.nabble.com/Chaining-Hostname-and-REST-Routes-tp26354930p26359097.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: