问题
This is a continuation of a previously asked and answered question that has cropped up again and needs a different solution ( different problem but same error message ).
Again the links to the shippingAddress action are not rendering:
<f:link.action action="shippingAddress" controller="Order" arguments="{address: shippingAddress, changeAddress: 1}"><f:translate id="seethroughweb.shop.change-address">Change</f:translate></f:link.action>
When debugging and expecting to find that the address variable is NULL but I found it was not, however it was being reported as the wrong type by var_dump - it was shown to be: TYPO3\Flow\Persistence\Doctrine\Proxies\__CG__\SeeThroughWeb\Shop\Domain\Model\Address persistable proxy
but should be:
SeeThroughWeb\Shop\Domain\Model\Address prototype persistable proxy
So the question now is - why is the wrong type reported? Why is the variable the wrong type? Looking at the code everything seems to refer to @param \SeeThroughWeb\Shop\Domain\Model\Address $address
The resulting exception in the Exception Logs is as before:
Uncaught exception #1316441798: No unique path segment could be found after 100 iterations.
80 TYPO3\Fluid\ViewHelpers\Link\ActionViewHelper_Original::render("shippingAddress", array|2|, "Order", NULL, NULL, "", "", array|0|, FALSE, array|0|, FALSE)
79 call_user_func_array(array|2|, array|11|)
回答1:
The error has nothing do do with the type of the class. TYPO3 Flow
creates proxy classes for each class. That means it generates new code and a new class for each of your classes.
The error is about a loop in the detection algorithm for the template. You somehow managed to trick Flow into going into an endless loop here.
回答2:
as Philipp already stated, these two issues are probably not related (in this case it's Doctrine though that creates the proxy, not Flow).
If you search for the exception code 1316441798, you can see that this exception is thrown in the IdentityRoutePart
.
Probably you have a route like the following:
-
uriPattern: 'some/path/{address}'
defaults:
'@package': 'SeeThroughWeb.Shop'
'@controller': 'Order'
'@action': 'shippingAddress'
routeParts:
'address':
objectType: 'SeeThroughWeb\Shop\Domain\Model\Address'
With the objectType
option you tell Flow to use a database table to map "{address}" to an instance of SeeThroughWeb\Shop\Domain\Model\Address
. This is done in order to keep the URL valid even if the entity changes.
If two entities resolve to the same URL segment, Flow will append a counter (e.g. "address-1", "address-2", ...). The exception is thrown if no unique segment could be resolved after 100 iterations.
See Flow documentation for further details on "Object Route Parts".
来源:https://stackoverflow.com/questions/30061506/part-2-what-does-this-fluid-error-mean-no-unique-path-segment-could-be-found