Development

#3423 (sfPatternRouting will return invalid information when cached route is used)

You must first sign up to be able to contribute.

Ticket #3423 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

sfPatternRouting will return invalid information when cached route is used

Reported by: FabianLange Assigned to: FabianLange
Priority: major Milestone: 1.1.0 RC1
Component: routing Version: 1.1.0 BETA4
Keywords: Cc:
Qualification: Design decision

Description

I am not sure if this is intentional. Line 617 of sfPatternRouting::parse method does "return" directly. It does skip lines 654-660 which set the currentInternal Route and emit logging.

all this is skipped by returning the data from cache.

Attachments

sfPatternRoutingTest.patch (1.6 kB) - added by FabianLange on 04/28/08 11:11:07.
Additional unit tests exposing this bug. It can be successfuly solved by applying #3424

Change History

04/28/08 10:25:05 changed by FabianLange

a fix is included in enhancement in: #3424

04/28/08 11:11:07 changed by FabianLange

  • attachment sfPatternRoutingTest.patch added.

Additional unit tests exposing this bug. It can be successfuly solved by applying #3424

04/28/08 11:29:18 changed by FabianLange

  • priority changed from minor to major.
  • summary changed from sfPatternRouting will emit no log message when cached route is used to sfPatternRouting will return invalid information when cached route is used.

just discovered that this will not only affect logging but internal state as well. When cache is used the internal uri will not be updated. The attached patchfile does demonstrate this

04/28/08 22:11:40 changed by FabianLange

  • milestone set to 1.1.0.

05/05/08 10:02:17 changed by fabien

  • milestone changed from 1.1.0 to 1.1.0 RC1.

05/06/08 14:53:24 changed by FabianLange

  • owner changed from fabien to FabianLange.
  • status changed from new to assigned.

05/06/08 15:52:58 changed by FabianLange

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [8806]) split sfPatternRouting::parse into two methods to allow side-effect free retrieval of route that might match a url. Useful for link rewriting that might want to check if a link will match an internal route, without actually "switching" there. Added PHPdoc for the new sfPatternRouting::findRoute(). Updated PHPdoc on sfRouting::parse, mentioning that this does modify internal state. Added unit tests to show issue of #3423. no separate tests for findRoute() needed as its implicitly tested by parse() tests. Added test to ensure that it is side effect free. Closes #3423, #3424