gpt4 book ai didi

php - Symfony 4.4 未知 inky_to_html 过滤器

转载 作者:行者123 更新时间:2023-12-01 22:18:46 25 4
gpt4 key购买 nike

我最近将 Symfony 更新到 4.4(从 4.3),并且无法再自动更新我的翻译文件(使用 php bin/console tran:up --force )。弹出的错误是:

In body.html.twig line 1:
Unknown "inky_to_html" filter.

有问题的文件是 vendor/symfony/twig-bridge/Resources/views/Email/zurb_2/notification/body.html.twig 我从未使用过,我不知道为什么包含它突然之间。为了摆脱这条消息,我尝试要求 twig/inky-extra 但这需要 ext-xsl-extension 并且我真的不想用我不需要的东西来膨胀我的代码消除与也不需要的 twig-extension 相关的错误。

我尝试按照描述更改翻译界面的版本 here ,但这也没有改变任何东西。

我想这与我的项目有关,因为我找不到任何类似的问题,但我无法弄清楚,所以感谢任何帮助。

编辑:这是我的composer.json,它与创建Symfony 4.3项目时生成的基本相同,我只是更改了版本名称以按照docs中的描述进行升级。并运行composer update

{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-intl": "*",
"apy/breadcrumbtrail-bundle": "^1.5",
"craue/config-bundle": "^2.3",
"easycorp/easy-log-handler": "^1.0",
"friendsofsymfony/jsrouting-bundle": "^2.4",
"league/csv": "^9.4",
"nesbot/carbon": "^2.25",
"sensio/framework-extra-bundle": "^5.1",
"sg/datatablesbundle": "^1.1",
"symfony/apache-pack": "^1.0",
"symfony/asset": "^4.0",
"symfony/console": "^4.0",
"symfony/dotenv": "^4.0",
"symfony/expression-language": "^4.0",
"symfony/flex": "^1.3.1",
"symfony/form": "^4.0",
"symfony/framework-bundle": "^4.0",
"symfony/http-client": "^4.0",
"symfony/intl": "^4.0",
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/process": "^4.0",
"symfony/security-bundle": "^4.0",
"symfony/security-csrf": "^4.0",
"symfony/serializer-pack": "*",
"symfony/swiftmailer-bundle": "^3.1",
"symfony/translation": "^4.0",
"symfony/twig-bundle": "^4.0",
"symfony/validator": "^4.0",
"symfony/web-link": "^4.0",
"symfony/yaml": "^4.0",
"tetranz/select2entity-bundle": "^3.0"
},
"require-dev": {
"dama/doctrine-test-bundle": "^6.1",
"doctrine/doctrine-fixtures-bundle": "^3.2",
"pdepend/pdepend": "^2.5",
"phpmd/phpmd": "^2.7",
"phpunit/php-code-coverage": "^7.0",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "3.*",
"symfony/debug-pack": "*",
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^4.3",
"symfony/profiler-pack": "*",
"symfony/test-pack": "*",
"symfony/web-server-bundle": "^4.0"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.4.*"
}
}
}

最佳答案

symfony/twig-bridge:4.4 将开发要求更改为要求 twig/inky-extra并添加了新的 Resources/views/Email利用 inky_to_html 的模板文件过滤器,未包含在 4.3 中。

tran:up尝试扫描<Bundle>/Resources/views内的文件每个包的翻译目录,为了规避该问题并避免扫描 twig-bridge View ,您应该能够指定要更新翻译的包名称。

php bin/console tran:up <locale> <bundle or directory>

除了包含开发要求来规避该问题之外,您还需要恢复到 symfony/symfony:4.3 以摆脱新的 twig-bridge/Resources/views/Email目录。

由于您使用的是 symfony/symfony:4.4,因此需要相应的 twig-bridge。

symfony/symfony:4.4 需要 [sic]

"symfony/twig-bridge": "self.version"

symfony/twig-bridge:4.4 require-dev [sic]

"twig/cssinliner-extra": "^2.12",
"twig/inky-extra": "^2.12",
"twig/markdown-extra": "^2.12"

最终这似乎是一个开发依赖项的错误,应该向 Symfony 报告。

<小时/>

更新:已发布 3.4+ 版本的补丁,请参阅:Fix the translation commands when a template contains a syntax error #34711

关于php - Symfony 4.4 未知 inky_to_html 过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59029924/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com