Zed.CRITICAL: Error - Call to undefined function twig_escape_filter()


#1

Hi,

after we updated our project, we get an error if we try to access a Table in Zed for example the Shipments, Products, etc. .
We observed that if we activate the WebProfiler than it works:

$config[WebProfilerConstants::ENABLE_WEB_PROFILER] = $config[ConfigConstants::ENABLE_WEB_PROFILER] = true;

If the Profiler is activated the Twig_Environment is loaded before the call in Spryker\Zed\Gui\Communication\Table\AbstractTable method twig_escape_filter() :

$value = twig_escape_filter(new Twig_Environment(new Twig_Loader_Filesystem()), $value);

The Error we get:

Zed.CRITICAL: Error - Call to undefined function Spryker\Zed\Gui\Communication\Table\twig_escape_filter() in "/var/www/spryker/releases/current/vendor/spryker/gui/src/Spryker/Zed/Gui/Communication/Table/AbstractTable.php::241" {"exception":"[object] (Error(code: 0): Call to undefined function Spryker\\Zed\\Gui\\Communication\\Table\\twig_escape_filter() at /var/www/spryker/releases/current/vendor/spryker/gui/src/Spryker/Zed/Gui/Communication/Table/AbstractTable.php:241) [stacktrace] #0 [internal function]: Spryker\\Zed\\Gui\\Communication\\Table\\AbstractTable->Spryker\\Zed\\Gui\\Communication\\Table\\{closure}('Ground +', 'spy_shipment_me...') #1 /var/www/spryker/releases/current/vendor/spryker/gui/src/Spryker/Zed/Gui/Communication/Table/AbstractTable.php(247): array_walk(Array, Object(Closure)) #2 /var/www/spryker/releases/current/vendor/spryker/gui/src/Spryker/Zed/Gui/Communication/Table/AbstractTable.php(218): Spryker\\Zed\\Gui\\Communication\\Table\\AbstractTable->escapeColumns(Array, Array) #3 /var/www/spryker/releases/current/vendor/spryker/gui/src/Spryker/Zed/Gui/Communication/Table/AbstractTable.php(721): Spryker\\Zed\\Gui\\Communication\\Table\\AbstractTable->loadData(Array) #4 /var/www/spryker/releases/current/vendor/spryker/shipment/src/Spryker/Zed/Shipment/Communication/Controller/IndexController.php(36): Spryker\\Zed\\Gui\\Communication\\Table\\AbstractTable->fetchData() #5 [internal function]: Spryker\\Zed\\Shipment\\Communication\\Controller\\IndexController->tableAction() #6 /var/www/spryker/releases/current/vendor/symfony/http-kernel/HttpKernel.php(144): call_user_func_array(Array, Array) #7 /var/www/spryker/releases/current/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1) #8 /var/www/spryker/releases/current/vendor/silex/silex/src/Silex/Application.php(586): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true) #9 /var/www/spryker/releases/current/vendor/silex/silex/src/Silex/Application.php(563): Silex\\Application->handle(Object(Symfony\\Component\\HttpFoundation\\Request)) #10 /var/www/spryker/releases/current/public/Zed/index.php(22): Silex\\Application->run()

Our composer.json:

“spryker-eco/braintree”: “~2.0.0”,
“spryker-eco/payone”: “1.4.0”,
“spryker-shop/availability-widget”: “~1.1.0”,
“spryker-shop/calculation-page”: “~1.0.0”,
“spryker-shop/cart-page”: “~1.4.0”,
“spryker-shop/catalog-page”: “~1.3.0”,
“spryker-shop/category-widget”: “~1.0.0”,
“spryker-shop/checkout-page”: “~1.7.0”,
“spryker-shop/checkout-widget”: “~1.1.0”,
“spryker-shop/cms-block-widget”: “~1.1.0”,
“spryker-shop/cms-content-widget-product-connector”: “~1.1.0”,
“spryker-shop/cms-page”: “~1.0.0”,
“spryker-shop/currency-widget”: “~1.1.0”,
“spryker-shop/customer-page”: “~1.14.0”,
“spryker-shop/customer-page-extension”: “~1.2.0”,
“spryker-shop/customer-reorder-widget”: “~3.1.0”,
“spryker-shop/discount-promotion-widget”: “~1.2.0”,
“spryker-shop/discount-widget”: “~1.1.0”,
“spryker-shop/error-page”: “~1.1.0”,
“spryker-shop/heartbeat-page”: “~1.0.0”,
“spryker-shop/home-page”: “~1.0.0”,
“spryker-shop/language-switcher-widget”: “~1.1.0”,
“spryker-shop/money-widget”: “~1.1.0”,
“spryker-shop/multi-cart-widget”: “~1.3.0”,
“spryker-shop/navigation-widget”: “~1.1.0”,
“spryker-shop/newsletter-page”: “~1.0.0”,
“spryker-shop/newsletter-widget”: “~1.2.0”,
“spryker-shop/price-widget”: “~1.1.0”,
“spryker-shop/product-category-widget”: “~1.1.0”,
“spryker-shop/product-detail-page”: “~1.7.0”,
“spryker-shop/product-image-widget”: “~1.0.0”,
“spryker-shop/product-widget”: “~1.2.0”,
“spryker-shop/redirect-page”: “~1.0.0”,
“spryker-shop/shop-application”: “~1.3.0”,
“spryker-shop/shop-application-extension”: “~1.0.0”,
“spryker-shop/shop-router”: “~1.0.0”,
“spryker-shop/shop-router-extension”: “~1.0.0”,
“spryker-shop/shop-translator”: “~1.0.0”,
“spryker-shop/shop-ui”: “~1.9.0”,
“spryker-shop/shop-ui-extension”: “~1.1.0”,
“spryker-shop/web-profiler-widget”: “~1.0.0”,
“spryker/acl”: “~3.1.0”,
“spryker/api”: “~0.1.0”,
“spryker/api-query-builder”: “~0.1.0”,
“spryker/application”: “~3.10.0”,
“spryker/assertion”: “~3.0.0”,
“spryker/auth”: “~3.0.0”,
“spryker/auth-mail-connector”: “~3.0.0”,
“spryker/availability”: “~6.3.0”,
“spryker/availability-cart-connector”: “~4.2.0”,
“spryker/availability-data-feed”: “~0.1.0”,
“spryker/availability-gui”: “~3.0.0”,
“spryker/availability-storage”: “~1.2.0”,
“spryker/cache”: “~3.1.0”,
“spryker/calculation”: “~4.4.0”,
“spryker/cart”: “~5.5.0”,
“spryker/cart-currency-connector”: “~1.1.0”,
“spryker/cart-extension”: “~1.6.0”,
“spryker/catalog”: “~5.3.0”,
“spryker/catalog-price-product-connector”: “~1.2.0”,
“spryker/category”: “~4.10.0”,
“spryker/category-data-feed”: “~0.2.0”,
“spryker/category-data-import”: “~0.2.0”,
“spryker/category-exporter”: “~3.0.0”,
“spryker/category-navigation-connector”: “~1.0.0”,
“spryker/category-page-search”: “~1.0.0”,
“spryker/category-storage”: “~1.2.0”,
“spryker/checkout”: “~4.2.0”,
“spryker/cms”: “~6.6.0”,
“spryker/cms-block”: “~2.1.0”,
“spryker/cms-block-category-connector”: “~2.1.0”,
“spryker/cms-block-category-storage”: “~1.0.0”,
“spryker/cms-block-collector”: “~2.0.0”,
“spryker/cms-block-gui”: “~2.0.0”,
“spryker/cms-block-product-connector”: “~1.1.0”,
“spryker/cms-block-product-storage”: “~1.0.0”,
“spryker/cms-block-storage”: “~1.0.0”,
“spryker/cms-collector”: “~2.0.0”,
“spryker/cms-content-widget”: “~1.2.0”,
“spryker/cms-content-widget-product-connector”: “~1.0.0”,
“spryker/cms-content-widget-product-group-connector”: “~1.0.0”,
“spryker/cms-content-widget-product-set-connector”: “~1.0.0”,
“spryker/cms-gui”: “~4.5.0”,
“spryker/cms-navigation-connector”: “~1.0.0”,
“spryker/cms-page-search”: “~1.0.0”,
“spryker/cms-storage”: “~1.1.0”,
“spryker/cms-user-connector”: “~1.0.0”,
“spryker/collector”: “~6.1.0”,
“spryker/collector-search-connector”: “~1.0.0”,
“spryker/collector-storage-connector”: “~1.0.0”,
“spryker/config”: “~3.1.0”,
“spryker/console”: “~4.0.0”,
“spryker/country”: “~3.2.0”,
“spryker/currency”: “~3.5.0”,
“spryker/currency-extension”: “~1.0.0”,
“spryker/customer”: “~7.14.0”,
“spryker/customer-api”: “~0.1.0”,
“spryker/customer-extension”: “~1.1.0”,
“spryker/customer-group”: “~2.3.0”,
“spryker/customer-group-discount-connector”: “~2.1.0”,
“spryker/customer-user-connector”: “~1.0.0”,
“spryker/customer-user-connector-gui”: “~1.1.0”,
“spryker/data-import”: “~1.4.0”,
“spryker/discount”: “~6.4.0”,
“spryker/discount-calculation-connector”: “~5.0.0”,
“spryker/discount-promotion”: “~1.1.0”,
“spryker/egulias”: “~1.0.0”,
“spryker/elastica”: “~4.0.0”,
“spryker/error-handler”: “~2.3.0”,
“spryker/event”: “~2.3.0”,
“spryker/event-behavior”: “~1.2.0”,
“spryker/event-journal”: “~3.0.0”,
“spryker/file-system”: “~1.0.0”,
“spryker/flysystem”: “~1.0.0”,
“spryker/flysystem-aws3v3-file-system”: “~1.0.0”,
“spryker/flysystem-ftp-file-system”: “~1.0.0”,
“spryker/flysystem-local-file-system”: “~1.0.0”,
“spryker/gift-card”: “~1.0.0”,
“spryker/gift-card-balance”: “~1.0.0”,
“spryker/gift-card-mail-connector”: “~1.0.0”,
“spryker/glossary”: “~3.5.0”,
“spryker/glossary-storage”: “~1.2.0”,
“spryker/graph”: “~3.0.0”,
“spryker/graphviz”: “~2.0.0”,
“spryker/gui”: “~3.15.0”,
“spryker/guzzle”: “~2.2.0”,
“spryker/heartbeat”: “~3.2.0”,
“spryker/install”: “~0.5.0”,
“spryker/installer”: “~4.0.0”,
“spryker/invoice”: “~2.0.0”,
“spryker/kernel”: “~3.27.0”,
“spryker/key-builder”: “~1.0.0”,
“spryker/locale”: “~3.1.0”,
“spryker/log”: “~3.5.0”,
“spryker/mail”: “~4.1.0”,
“spryker/maintenance”: “~3.1.0”,
“spryker/mandrill”: “~2.0.0”,
“spryker/messenger”: “~3.1.0”,
“spryker/money”: “~2.4.0”,
“spryker/monolog”: “~2.0.0”,
“spryker/navigation”: “~2.3.0”,
“spryker/navigation-collector”: “~1.0.0”,
“spryker/navigation-gui”: “~2.2.0”,
“spryker/navigation-storage”: “~1.1.0”,
“spryker/newsletter”: “~4.3.0”,
“spryker/nopayment”: “~4.0.0”,
“spryker/oms”: “~8.4.0”,
“spryker/oms-discount-connector”: “~3.0.0”,
“spryker/payment”: “~4.3.0”,
“spryker/payment-cart-connector”: “~1.0.0”,
“spryker/pimple”: “~2.0.0”,
“spryker/price”: “~5.3.0”,
“spryker/price-cart-connector”: “~4.5.0”,
“spryker/price-data-feed”: “~0.2.0”,
“spryker/price-extension”: “~1.0.0”,
“spryker/price-product”: “~2.5.0”,
“spryker/price-product-storage”: “~2.5.0”,
“spryker/product”: “~6.7.0”,
“spryker/product-abstract-data-feed”: “~0.2.0”,
“spryker/product-api”: “~0.1.0”,
“spryker/product-attribute”: “~1.1.0”,
“spryker/product-attribute-gui”: “~1.0.0”,
“spryker/product-cart-connector”: “~4.3.0”,
“spryker/product-category”: “~4.6.0”,
“spryker/product-category-filter”: “~1.2.0”,
“spryker/product-category-filter-collector”: “~1.0.0”,
“spryker/product-category-filter-gui”: “~1.1.0”,
“spryker/product-category-filter-storage”: “~1.0.0”,
“spryker/product-category-storage”: “~1.2.0”,
“spryker/product-discount-connector”: “~3.2.0”,
“spryker/product-image”: “~3.5.0”,
“spryker/product-image-cart-connector”: “~1.0.0”,
“spryker/product-image-storage”: “>=1.0.0 < 1.1.0”,
“spryker/product-management”: “~0.14.0”,
“spryker/product-option”: “~6.6.0”,
“spryker/product-option-cart-connector”: “~5.0.0”,
“spryker/product-option-storage”: “~1.1.0”,
“spryker/product-page-search”: “~2.4.0”,
“spryker/product-quantity”: “~1.1.0”,
“spryker/product-quantity-storage”: “~1.0.0”,
“spryker/product-search”: “~5.6.0”,
“spryker/product-search-config-storage”: “~1.0.0”,
“spryker/product-storage”: “~1.5.0”,
“spryker/product-validity”: “~1.0.0”,
“spryker/propel”: “~3.8.0”,
“spryker/propel-orm”: “~1.8.0”,
“spryker/propel-query-builder”: “~0.3.0”,
“spryker/queue”: “~1.2.0”,
“spryker/quote”: “~2.4.0”,
“spryker/quote-extension”: “~1.1.0”,
“spryker/rabbit-mq”: “~2.2.0”,
“spryker/redis”: “~2.0.0”,
“spryker/refund”: “~5.1.0”,
“spryker/sales”: “~8.16.0”,
“spryker/sales-extension”: “~1.2.0”,
“spryker/sales-product-connector”: “~1.1.0”,
“spryker/sales-split”: “~3.0.0”,
“spryker/search”: “~8.3.0”,
“spryker/sequence-number”: “~3.1.0”,
“spryker/session”: “~3.2.0”,
“spryker/setup”: “~4.1.0”,
“spryker/setup-frontend”: “~1.0.0”,
“spryker/shipment”: “~6.6.0”,
“spryker/shipment-cart-connector”: “~1.0.0”,
“spryker/shipment-checkout-connector”: “~1.0.0”,
“spryker/shipment-discount-connector”: “~1.1.0”,
“spryker/silex”: “~2.0.0”,
“spryker/sql-criteria-builder”: “~1.0.0”,
“spryker/state-machine”: “~2.2.0”,
“spryker/step-engine”: “~3.2.0”,
“spryker/stock”: “~5.0.0”,
“spryker/stock-sales-connector”: “~3.0.0”,
“spryker/storage”: “~3.5.0”,
“spryker/store”: “~1.9.0”,
“spryker/symfony”: “~3.1.0”,
“spryker/synchronization”: “~1.2.0”,
“spryker/synchronization-behavior”: “~1.3.0”,
“spryker/synchronization-extension”: “~1.0.0”,
“spryker/tax”: “~5.5.0”,
“spryker/tax-product-connector”: “~4.1.0”,
“spryker/touch”: “~4.0.0”,
“spryker/transfer”: “~3.7.0”,
“spryker/twig”: “~3.3.0”,
“spryker/url”: “~3.4.0”,
“spryker/url-collector”: “~1.0.0”,
“spryker/url-storage”: “~1.1.0”,
“spryker/user”: “~3.5.0”,
“spryker/util-validate”: “~1.0.0”,
“spryker/zed-navigation”: “~1.2.0”,
“spryker/zed-request”: “~3.5.0”,
“spryker/zend”: “~2.1.0”,
“swiftmailer/swiftmailer”: “~5.4.0”

Best Regards,
Jozsef


#2

Hi Jozsef,

Sorry for such a late reply. I was trying to reproduce your problem.
So far I need more details from you in order to try to help.
Could you please say what version of twig is installed at the moment? Run composer show twig/twig.

Best regards,
Valerii