Chaining Hostname and REST Routes

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Chaining Hostname and REST Routes

Bradley Holt
Has anyone successfully chained together a Hostname and a REST route?
My REST route works fine on its own, but dispatching breaks once I
chain it together with a hostname route. Here's a stripped down
example that I would think should work:

        // I'm obviously not using example.com, but I *have*
double-checked the domain
        // The reason for this route is that I'm going to use the
scheme parameter and set it to https
        $hostnameRoute = new Zend_Controller_Router_Route_Hostname(
            'example.com'
        );
        // If I were to *only* add this route, not chained with the
hostname route, everything would work fine
        // Note that I'm only adding the REST route for the checkout
module, in case that's relevant
        $restRoute = new Zend_Rest_Route(
            $this->_front,
            array(),
            array(
               'checkout'
            )
        );
        // I've tried chaining each route to the other instead of using a chain
        $chainedRoute = new Zend_Controller_Router_Route_Chain();
        $chainedRoute
            ->chain($hostnameRoute)
            ->chain($restRoute)
        ;
        // For now I'm not changing the route name so existing code
doesn't break
        $router->addRoute(
            'rest',
            $chainedRoute
        );

Then, upon requesting:

http://example.com/checkout/order/some-id

and examining my request in the preDispatch of a controller plugin I
see the following, incorrect, parameters:

    'module' => string 'checkout'
    'controller' => string 'order'
    'action' => string 'some-id'

The parameters I would expect are:

    'module' => string 'checkout'
    'controller' => string 'order'
    'action' => string 'get'
    'id' => string 'some-id'

Am I doing something wrong or is chaining Hostname and REST routes
together not supported?

Thanks,
Bradley

--
Bradley Holt
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

Bradley Holt
I should add that assembling the route with those same parameters
gives the expected result:

        die(
            $chainedRoute->assemble(
                array (
                    'module'        => 'checkout',
                    'controller'    => 'order',
                    'action'        => 'get',
                    'id'            => 'some-id',
                )
            )
        );

correctly gives me:

http://example.com/checkout/order/some-id

The problem is that during dispatching it can't seem to figure out the
correct parameters from the URL.

Thanks,
Bradley

--
Bradley Holt
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

SpiffyJr
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.
Kyle S
blogs @ www.spiffyjr.me
github @ www.github.com/spiffyjr
follow @ www.twitter.com/spiffyjr
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

Bradley Holt
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 <[hidden email]> 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
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

Bradley Holt
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
<[hidden email]> 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 <[hidden email]> 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
> [hidden email]
>



--
Bradley Holt
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

Bradley Holt
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
<[hidden email]> 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
> <[hidden email]> 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 <[hidden email]> 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
>> [hidden email]
>>
>
>
>
> --
> Bradley Holt
> [hidden email]
>



--
Bradley Holt
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

SpiffyJr

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.
Kyle S
blogs @ www.spiffyjr.me
github @ www.github.com/spiffyjr
follow @ www.twitter.com/spiffyjr
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

Bradley Holt
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 <[hidden email]> 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
>> <[hidden email]> 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
>>> <[hidden email]> 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 <[hidden email]>
>>>> 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
>>>> [hidden email]
>>>>
>>>
>>>
>>>
>>> --
>>> Bradley Holt
>>> [hidden email]
>>>
>>
>>
>>
>> --
>> Bradley Holt
>> [hidden email]
>>
>>
>
> 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
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

SpiffyJr

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.
Kyle S
blogs @ www.spiffyjr.me
github @ www.github.com/spiffyjr
follow @ www.twitter.com/spiffyjr
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

SpiffyJr

Kyle Spraggs wrote
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.
I JUST downloaded a fresh copy of ZF 1.9.5 and the changes listed in he ticket above (ZF-7928) are NOT PRESENT in the Zend/Rest/Route.php file of ZF 1.9.5. I'm going to manually apply the changes and see if this fixes my issue.
Kyle S
blogs @ www.spiffyjr.me
github @ www.github.com/spiffyjr
follow @ www.twitter.com/spiffyjr
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

SpiffyJr
In reply to this post by SpiffyJr

Kyle Spraggs wrote
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.

Ah ha! Applying the changes manually causes my chain to work as expected. I'm not sure what the proper steps are now. Do I create a new ticket? The issue is resolved but is not being packaged with the latest versions.
Kyle S
blogs @ www.spiffyjr.me
github @ www.github.com/spiffyjr
follow @ www.twitter.com/spiffyjr
Reply | Threaded
Open this post in threaded view
|

Re: Chaining Hostname and REST Routes

Bradley Holt
Kyle,

I reopened the issue. It appears to have been fixed in trunk but not
in the release-1.9 branch (which explains why it's not in 1.9.4 or
1.9.5). Switching to using trunk should fix the issue as well, but of
course could be unstable.

Thanks,
Bradley

On Sun, Nov 15, 2009 at 8:55 AM, Kyle Spraggs <[hidden email]> wrote:

>
>
>
> Kyle Spraggs wrote:
>>
>>
>>
>> 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 <[hidden email]> 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
>>>>> <[hidden email]> 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
>>>>>> <[hidden email]> 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 <[hidden email]>
>>>>>>> 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
>>>>>>> [hidden email]
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Bradley Holt
>>>>>> [hidden email]
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Bradley Holt
>>>>> [hidden email]
>>>>>
>>>>>
>>>>
>>>> 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
>>> [hidden email]
>>>
>>>
>>
>> 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.
>>
>
>
> Ah ha! Applying the changes manually causes my chain to work as expected.
> I'm not sure what the proper steps are now. Do I create a new ticket? The
> issue is resolved but is not being packaged with the latest versions.
> --
> View this message in context: http://old.nabble.com/Chaining-Hostname-and-REST-Routes-tp26354930p26359288.html
> Sent from the Zend MVC mailing list archive at Nabble.com.
>
>



--
Bradley Holt
[hidden email]