Bug #56607

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

Added by Bastian Waidelich over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Should have
Category:
MVC - Routing
Target version:
-
Start date:
2014-03-06
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

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:

-
  name: 'Single product route'
  uriPattern: 'products/{product}'
  defaults:
    '@package':     'My.Demo'
    '@controller':  'Product'
    '@action':      'show'
  routeParts:
    product:
      objectType: 'My\Demo\Domain\Model\Product'
      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

Has duplicate TYPO3.Flow - Bug #56608: Don't use object path mapping for object routes without custom uriPatternClosedBastian Waidelich2014-03-06

Actions
#1

Updated by Bastian Waidelich over 7 years ago

FYI: This is already the case if you don't use custom identity properties: In that case the technical identifier (usually the UUID) is used and no objectPathMapping will be created!

#2

Updated by Bastian Waidelich over 7 years ago

  • Status changed from Accepted to Closed

As mentioned above, this is already the case in current master

Also available in: Atom PDF