从 8 升级到 Drupal 9 出现 Twig 相关错误

Upgrade to Drupal 9 from8 having Twig related error

我最近通过 composer 将 drupal 升级到 9 版本。我在 drush watchdog:show 命令

中遇到以下错误
Error: Class 'Twig_Function_Function' not found in  
Drupal\bookmark_field\TwigExtension\BookmarkExtension->getFunctions()

Twig_Function_Functiondeprecated class from Twig 1, the use of which was deprecated in Drupal 8 and has now been removed as Drupal 9 requires Twig 2.

在您的 bookmark_field 模块中,您需要更新代码以使用 \Twig\TwigFunction 而不是旧的 Twig_Function_Function