简体   繁体   English

f:uri.image的内联符号在typo3 8.3.0中被破坏了吗?

[英]Is inline notation of f:uri.image broken in typo3 8.3.0?

I use the TYPO3\\CMS\\Frontend\\DataProcessing\\FilesProcessor to access FAL Images 我使用TYPO3\\CMS\\Frontend\\DataProcessing\\FilesProcessor来访问FAL图像

dataProcessing {
    20 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    20 {
        references.fieldName = image
        as = images
    }
}

the use of <f:uri.image image="{images.0}" /> works fine but {f:uri.image(image:'{images.0}')} or {f:uri.image(image:images.0)} 使用<f:uri.image image="{images.0}" />工作正常,但{f:uri.image(image:'{images.0}')}{f:uri.image(image:images.0)}

gives me a FE Error: 给我一个FE错误:

#1: PHP Warning: htmlspecialchars() expects parameter 1 to be string, object given in typo3_cms8/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/EscapingNode.php line 41 #1:PHP警告:htmlspecialchars()期望参数1为字符串,对象在 typo3_cms8 / vendor / typo3fluid / fluid / src / Core / Parser / SyntaxTree / EscapingNode.php第41行中给出

Info: in 7.LTS the code works 信息:在7.LTS中代码有效

This is caused by two things in combination: 这是由两件事组合造成的:

  • The {images.0} variable is an object and has no __toString method {images.0}变量是一个对象,没有__toString方法
  • The parameter is passed wrapped in a TextNode in the provided inline example 参数传递包含在提供的内联示例中的TextNode中

To correct this problem avoid wrapping the object accessor in a text node: 要解决此问题,请避免将对象访问器包装在文本节点中:

{f:uri(image: images.0)}

For a much more detailed explanation about this you can view my video about the subject: Mastering Fluid - Accessing Variables . 有关此问题的更详细说明,您可以查看关于主题的视频: 掌握流体 - 访问变量

I should also add that we are indeed aware of this edge case of variables which are incompatible with strings being wrapped in a TextNode. 我还应该补充一点,我们确实知道变量的边缘情况,这些变量与包在TextNode中的字符串不兼容。 So far the decision is that we would rather allow this edge case to slip through and avoid adding a condition that would need to check every variable in every template which cumulative would be billions upon billions of conditions with the single goal of avoiding this warning. 到目前为止,我们的决定是,我们宁愿允许这种边缘情况滑过,并避免添加一个条件,需要检查每个模板中的每个变量,累积数十亿条件的数十亿条件,单一目标是避免此警告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM