Bug #89427
closed
UnknownNamespaceException since 8.7.28
Added by Christoph Lehmann about 5 years ago.
Updated almost 5 years ago.
Description
My template looks like this
{namespace site=Tx_MySite_Viewhelpers}
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default"/>
<f:section name="main">
...
and since 8.7.28 i get
Fluid parse error in template Sitemap_action_list_f6624df9f507d11f4e34c81ba212a7897b58f7b0, line 19 at character 1. Error: Unknown Namespace: site (error code 0). Template source chunk: <f:for each="{site:NewsPagebrowserSitemap(storagePid: settings.newsPressReview.storagePid, itemsPerPage:15)}" as="item" iteration="index">
Is it luck that it worked until now? Was the support dropped for non namespaced viewhelpers?
There has to be some other explanation why this worked. TYPO3 8.7 has since the start used the decoupled Fluid as basis, and neither the ViewHelperResolver of Fluid nor the one from TYPO3 have ever been capable of generating an expected class name with underscores.
This leads me to suspect that it probably did not work - but that you're now seeing a proper error about the invalid namespace, whereas before this problem was fixed in Fluid, the namespace would be (incorrectly!) ignored. This bug was fixed with Fluid 2.6.4 which does indeed throw one additional potential error about use of invalid namespaces. It's possible your template is parsed but the specific place in the template was never actually rendered (if it were rendered and the namespace ignored, you likely would see an error about "expected array, got string").
In any case: as far as I can tell, legacy namespaces were never supported on TYPO3 8.7. It's possible your specific system used an override or XCLASS to work around that but the only official advise is to update the namespace (and indeed the class loading altogether!) to no longer use the legacy class names.
Hey Claus,
thanks for your explanation.
I already fixed the namespace, so lets close this issue.
- Status changed from New to Resolved
I think I've narrowed down the cause to https://github.com/TYPO3/Fluid/commit/2d2d5db7268f57b9f8e83e0d3c474f7603b54cab which has the following effect:
Inline ViewHelpers used as arguments for tag-mode ViewHelpers were not recursively validated before refactoring the validation; same is true for inline ViewHelpers used as arguments for inline ViewHelpers. The previous implementation would have simply hidden the error - it would still have been raised, had you attempted to render the template/section.
This is likely why you see the error now. The outer VH in your code example is valid, therefore the inner VH was never validated by the pre-processor until now.
- Status changed from Resolved to Closed
Also available in: Atom
PDF