Bug #56608

Don't use object path mapping for object routes without custom uriPattern

Added by Bastian Waidelich over 1 year ago. Updated over 1 year ago.

Status:Closed Start date:2014-03-06
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

0%

Category:MVC - Routing
Target version:-
PHP Version: Complexity:
Has patch:No Affected Flow version:(any)

Description

Currently if you use the object route part handler, Flow adds an "ObjectPathMapping" record when the URL is created the first time.
This is done because the association might not be deterministic:

 1-
 2  name: 'Single product route'
 3  uriPattern: 'products/{product}'
 4  defaults:
 5    '@package':     'My.Demo'
 6    '@controller':  'Product'
 7    '@action':      'show'
 8  routeParts:
 9    product:
10      objectType: 'My\Demo\Domain\Model\Product'
11      uriPattern: '{product.name}'

In this case, if multiple products have the same name flow would create separate ObjectPathMappings with a unique suffix ("<product.name>-<n>" where n is a number starting with 1).

However this is not required if the mapping is deterministic, e.g. if the "uriPattern" is not specified. In that case Flow falls back to using the Identity properties and we don't need to persist ObjectPathMappings.


Related issues

duplicates TYPO3.Flow - Bug #56607: Don't use object path mapping for object routes without c... Closed 2014-03-06

History

#1 Updated by Bastian Waidelich over 1 year ago

  • Status changed from Accepted to Closed

Closing as duplicate of #56607 (no idea, why I created two issues)

Also available in: Atom PDF