a2lix / TranslationFormBundle

Ease translations with some dedicated Symfony form types
https://a2lix.fr/bundles/translation-form
MIT License
330 stars 140 forks source link

Templating config entry seems broken #352

Closed welcoMattic closed 4 years ago

welcoMattic commented 4 years ago

Environment

Symfony 5.1.2

Composer packages

Show

```bash $ composer show a2lix/auto-form-bundle 0.3.1 Automate form building a2lix/translation-form-bundle 3.0.7 Translate your doctrine objects easily with some helps amphp/amp v2.4.4 A non-blocking concurrency framework for PHP applications. amphp/artax v3.0.14 Asynchronous parallel HTTP/1.1 client built on the Amp concurrency framework amphp/byte-stream v1.7.3 A stream abstraction to make working with non-blocking I/O simple. amphp/cache v1.4.0 A promise-aware caching API for Amp. amphp/dns v0.9.15 Async DNS resolution for Amp. amphp/file v0.3.5 Allows non-blocking access to the filesystem for Amp. amphp/parallel v1.4.0 Parallel processing component for Amp. amphp/parser v1.0.0 A generator parser to make streaming parsers simple. amphp/process v1.1.0 Asynchronous process manager. amphp/serialization v1.0.0 Serialization tools for IPC and data storage in PHP. amphp/socket v0.10.13 Async socket connection / server tools for Amp. amphp/sync v1.4.0 Mutex, Semaphore, and other synchronization tools for Amp. amphp/uri v0.1.4 Uri Parser and Resolver. amphp/windows-registry v0.3.2 Windows Registry Reader. behat/transliterator v1.3.0 String transliterator bovigo/assert v6.0.0 Provides assertions for unit tests. brick/math 0.8.15 Arbitrary-precision arithmetic library clue/stream-filter v1.4.1 A simple and modern approach to stream filtering in PHP composer/package-versions-deprecated 1.8.1 Composer plugin that provides efficient querying for installed package versions (no runtime IO) composer/semver 1.5.1 Semver library that offers utilities, version constraint parsing and validation. composer/xdebug-handler 1.4.2 Restarts a process without Xdebug. daverandom/libdns v2.0.2 DNS protocol implementation written in pure PHP doctrine/annotations 1.10.3 Docblock Annotations Parser doctrine/cache 1.10.1 PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such... doctrine/collections 1.6.5 PHP Doctrine Collections library that adds additional functionality on top of PHP arrays. doctrine/common 2.13.3 PHP Doctrine Common project is a library that provides additional functionality that other Doctrine pr... doctrine/data-fixtures 1.4.3 Data Fixtures for all Doctrine Object Managers doctrine/dbal 2.10.2 Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection an... doctrine/doctrine-bundle 2.1.0 Symfony DoctrineBundle doctrine/doctrine-fixtures-bundle 3.3.1 Symfony DoctrineFixturesBundle doctrine/doctrine-migrations-bundle 2.1.2 Symfony DoctrineMigrationsBundle doctrine/event-manager 1.1.0 The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doc... doctrine/inflector 1.4.3 PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/l... doctrine/instantiator 1.3.1 A small, lightweight utility to instantiate objects in PHP without invoking their constructors doctrine/lexer 1.2.1 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers. doctrine/migrations 2.2.1 PHP Doctrine Migrations project offer additional functionality on top of the database abstraction laye... doctrine/orm v2.7.3 Object-Relational-Mapper for PHP doctrine/persistence 1.3.7 The Doctrine Persistence project is a set of shared interfaces and functionality that the different Do... doctrine/reflection 1.2.1 The Doctrine Reflection project is a simple library used by the various Doctrine projects which adds s... doctrine/sql-formatter 1.1.0 a PHP SQL highlighting library drewm/mailchimp-api v2.5.4 Super-simple, minimum abstraction MailChimp API v3 wrapper easycorp/easyadmin-bundle v2.3.6 Admin generator for Symfony applications egulias/email-validator 2.1.18 A library for validating emails against several RFCs elasticsearch/elasticsearch v6.7.2 PHP Client for Elasticsearch friendsofapi/localise.biz 1.0.1 A community API client for localise.biz translation service friendsofphp/php-cs-fixer v2.16.4 A tool to automatically fix PHP code style friendsofsymfony/ckeditor-bundle 2.2.0 Provides a CKEditor integration for your Symfony project. fzaninotto/faker v1.9.1 Faker is a PHP library that generates fake data for you. gedmo/doctrine-extensions v2.4.41 Doctrine2 behavioral extensions giggsey/libphonenumber-for-php 8.12.7 PHP Port of Google's libphonenumber giggsey/locale 1.8 Locale functions required by libphonenumber-for-php guzzlehttp/guzzle 6.5.5 Guzzle is a PHP HTTP client library guzzlehttp/promises v1.3.1 Guzzle promises library guzzlehttp/psr7 1.6.1 PSR-7 message implementation that also provides common utility methods guzzlehttp/ringphp 1.1.1 Provides a simple API and specification that abstracts away the details of HTTP into a single PHP func... guzzlehttp/streams 3.0.0 Provides a simple abstraction over streams of data imagine/imagine 1.2.3 Image processing for PHP 5.3 jean85/pretty-package-versions 1.5.0 A wrapper for ocramius/package-versions to get pretty versions strings jms/metadata 2.3.0 Class/method/property metadata management in PHP jolicode/asynit dev-fix/disable-tls-peer-verification 455c09e Asynchronous HTTP Request Testing Library for API or more... jolicode/seo-override dev-master a91f522 Override your seo markup on the fly kelunik/certificate v1.1.2 Access certificate details and transform between different formats. knplabs/doctrine-behaviors v2.0.6 Doctrine Behavior Traits knpuniversity/oauth2-client-bundle v1.34.0 Integration with league/oauth2-client to provide services laminas/laminas-code 3.4.1 Extensions to the PHP Reflection API, static code scanning, and code generation laminas/laminas-eventmanager 3.2.1 Trigger and listen to events within a PHP application laminas/laminas-zendframework-bridge 1.0.4 Alias legacy ZF class names to Laminas Project equivalents. league/csv 9.6.0 CSV data manipulation made easy in PHP league/flysystem 1.0.69 Filesystem abstraction: Many filesystems, one API. league/oauth2-client 2.4.1 OAuth 2.0 Client Library league/oauth2-facebook 2.0.1 Facebook OAuth 2.0 Client Provider for The PHP League OAuth2-Client league/oauth2-google 3.0.2 Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client liip/imagine-bundle 2.3.1 This bundle provides an image manipulation abstraction toolkit for Symfony-based projects. monolog/monolog 2.1.0 Sends your logs to files, sockets, inboxes, databases and various web services myclabs/php-enum 1.7.6 PHP Enum implementation nette/finder v2.5.2 πŸ” Nette Finder: find files and directories with an intuitive API. nette/robot-loader v3.2.3 πŸ€ Nette RobotLoader: high performance and comfortable autoloader that will search and autoload clas... nette/utils v3.1.2 πŸ›  Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON enc... nikic/php-parser v4.5.0 A PHP parser written in PHP nyholm/nsa 1.2.0 See everything and do whatever you want. No privacy rule will stop us. Used in tests, debugging and fi... ocramius/proxy-manager 2.2.3 A library providing utilities to generate, instantiate and generally operate with Object Proxies odolbeau/phone-number-bundle v3.1.1 Integrates libphonenumber into your Symfony application ondram/ci-detector 3.4.0 Detect continuous integration environment and provide unified access to properties of current build pagerfanta/pagerfanta v2.3.0 Pagination for PHP paragonie/random_compat v9.99.99 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7 pelago/emogrifier v3.1.0 Converts CSS styles into inline style attributes in your HTML code php-cs-fixer/diff v1.3.0 sebastian/diff v2 backport support for PHP5.6 php-http/client-common 1.10.0 Common HTTP Client implementations and tools for HTTPlug php-http/discovery 1.9.0 Finds installed HTTPlug implementations and PSR-7 message factories php-http/guzzle6-adapter v1.1.1 Guzzle 6 HTTP Adapter php-http/httplug v1.1.0 HTTPlug, the HTTP client abstraction for PHP php-http/httplug-bundle 1.18.0 Symfony integration for HTTPlug php-http/logger-plugin 1.1.0 PSR-3 Logger plugin for HTTPlug php-http/message 1.8.0 HTTP Message related tools php-http/message-factory v1.0.2 Factory interfaces for PSR-7 HTTP Message php-http/multipart-stream-builder 1.1.1 A builder class that help you create a multipart stream php-http/promise v1.0.0 Promise used for asynchronous HTTP requests php-http/stopwatch-plugin 1.3.0 Symfony Stopwatch plugin for HTTPlug php-translation/common 3.0.1 Common translation stuff php-translation/extractor 2.0.2 Extract translations form the source code php-translation/loco-adapter 0.10.0 Adapter for loco. php-translation/symfony-bundle 0.12.3 php-translation/symfony-storage 2.2.0 A translation file storage using Symfony translation component. phpdocumentor/reflection-common 2.2.0 Common reflection classes used by phpdocumentor to reflect the code structure phpdocumentor/reflection-docblock 4.3.4 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve... phpdocumentor/type-resolver 1.3.0 A PSR-5 based resolver of Class names, Types and Structural Element Names phpstan/phpdoc-parser 0.4.8 PHPDoc parser with support for nullable, intersection and generic types phpstan/phpstan 0.12.32 PHPStan - PHP Static Analysis Tool phpstan/phpstan-doctrine 0.12.17 Doctrine extensions for PHPStan phpstan/phpstan-phpunit 0.12.11 PHPUnit extensions and rules for PHPStan psr/cache 1.0.1 Common interface for caching libraries psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11) psr/event-dispatcher 1.0.0 Standard interfaces for event handling. psr/http-factory 1.0.1 Common interfaces for PSR-7 HTTP message factories psr/http-message 1.0.1 Common interface for HTTP messages psr/log 1.1.3 Common interface for logging libraries psr/simple-cache 1.0.1 Common interfaces for simple caching ralouphie/getallheaders 3.0.3 A polyfill for getallheaders. ramsey/collection 1.0.1 A PHP 7.2+ library for representing and manipulating collections. ramsey/uuid 4.0.1 A PHP library for generating and working with universally unique identifiers (UUIDs). [45/17739] react/promise v2.8.0 A lightweight implementation of CommonJS Promises/A for PHP rector/rector v0.7.43 Instant upgrade and refactoring of your PHP code ruflin/elastica 6.1.1 Elasticsearch Client sebastian/comparator 4.0.3 Provides the functionality to compare PHP values for equality sebastian/diff 4.0.2 Diff implementation sebastian/exporter 4.0.2 Provides the functionality to export PHP variables for visualization sebastian/recursion-context 4.0.2 Provides functionality to recursively process PHP variables sensio/framework-extra-bundle v5.5.6 This bundle provides a way to configure your controllers with annotations symfony/asset v5.1.2 Symfony Asset Component symfony/browser-kit v5.1.2 Symfony BrowserKit Component symfony/cache v5.1.2 Symfony Cache component with PSR-6, PSR-16, and tags symfony/cache-contracts v2.1.3 Generic abstractions related to caching symfony/config v5.1.2 Symfony Config Component symfony/console v5.1.2 Symfony Console Component symfony/css-selector v5.1.2 Symfony CssSelector Component symfony/debug-bundle v5.1.2 Symfony DebugBundle symfony/debug-pack v1.0.8 A debug pack for Symfony projects symfony/dependency-injection v5.1.2 Symfony DependencyInjection Component symfony/deprecation-contracts v2.1.3 A generic function and convention to trigger deprecation notices symfony/doctrine-bridge v5.1.2 Symfony Doctrine Bridge symfony/dom-crawler v5.1.2 Symfony DomCrawler Component symfony/dotenv v5.1.2 Registers environment variables from a .env file symfony/error-handler v5.1.2 Symfony ErrorHandler Component symfony/event-dispatcher v5.1.2 Symfony EventDispatcher Component symfony/event-dispatcher-contracts v2.1.3 Generic abstractions related to dispatching event symfony/expression-language v5.1.2 Symfony ExpressionLanguage Component symfony/filesystem v5.1.2 Symfony Filesystem Component symfony/finder v5.1.2 Symfony Finder Component symfony/flex v1.8.4 Composer plugin for Symfony symfony/form v5.1.2 Symfony Form Component symfony/framework-bundle v5.1.2 Symfony FrameworkBundle symfony/http-client v5.1.2 Symfony HttpClient component symfony/http-client-contracts v2.1.3 Generic abstractions related to HTTP clients symfony/http-foundation v5.1.2 Symfony HttpFoundation Component symfony/http-kernel v5.1.2 Symfony HttpKernel Component symfony/inflector v5.1.2 Symfony Inflector Component symfony/intl v5.1.2 A PHP replacement layer for the C intl extension that includes additional data from the ICU library. symfony/lock v5.1.2 Symfony Lock Component symfony/mailchimp-mailer v5.1.2 Symfony Mailchimp Mailer Bridge symfony/mailer v5.1.2 Symfony Mailer Component symfony/maker-bundle v1.19.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can fo... symfony/mime v5.1.2 A library to manipulate MIME messages symfony/monolog-bridge v5.1.2 Symfony Monolog Bridge symfony/monolog-bundle v3.5.0 Symfony MonologBundle symfony/options-resolver v5.1.2 Symfony OptionsResolver Component symfony/phpunit-bridge v5.1.2 Symfony PHPUnit Bridge symfony/polyfill-ctype v1.17.1 Symfony polyfill for ctype functions symfony/polyfill-intl-grapheme v1.17.1 Symfony polyfill for intl's grapheme_* functions symfony/polyfill-intl-icu v1.17.1 Symfony polyfill for intl's ICU-related data and classes symfony/polyfill-intl-idn v1.17.1 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions symfony/polyfill-intl-normalizer v1.17.1 Symfony polyfill for intl's Normalizer class and related functions symfony/polyfill-mbstring v1.17.1 Symfony polyfill for the Mbstring extension symfony/polyfill-php72 v1.17.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions symfony/polyfill-php73 v1.17.1 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions symfony/polyfill-php80 v1.17.1 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions symfony/process v5.1.2 Symfony Process Component symfony/profiler-pack v1.0.4 A pack for the Symfony web profiler symfony/property-access v5.1.2 Symfony PropertyAccess Component symfony/property-info v5.1.2 Symfony Property Info Component symfony/routing v5.1.2 Symfony Routing Component symfony/security-bundle v5.1.2 Symfony SecurityBundle symfony/security-core v5.1.2 Symfony Security Component - Core Library symfony/security-csrf v5.1.2 Symfony Security Component - CSRF Library symfony/security-guard v5.1.2 Symfony Security Component - Guard symfony/security-http v5.1.2 Symfony Security Component - HTTP Integration symfony/serializer v5.1.2 Symfony Serializer Component symfony/service-contracts v2.1.3 Generic abstractions related to writing services symfony/stopwatch v5.1.2 Symfony Stopwatch Component symfony/string v5.1.2 Symfony String component symfony/templating v5.1.2 Symfony Templating Component symfony/translation v5.1.2 Symfony Translation Component symfony/translation-contracts v2.1.3 Generic abstractions related to translation symfony/twig-bridge v5.1.2 Symfony Twig Bridge symfony/twig-bundle v5.1.2 Symfony TwigBundle symfony/validator v5.1.2 Symfony Validator Component symfony/var-dumper v5.1.2 Symfony mechanism for exploring and dumping PHP variables symfony/var-exporter v5.1.2 A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code symfony/web-profiler-bundle v5.1.2 Symfony WebProfilerBundle symfony/webpack-encore-pack v1.0.2 A pack for Symfony Encore symfony/yaml v5.1.2 Symfony Yaml Component symplify/auto-bind-parameter v8.1.4 Auto bind parameters for your Symfony applications symplify/autowire-array-parameter v8.1.4 Autowire array parameters for your Symfony applications symplify/console-color-diff v8.1.4 Package to print diffs in console with colors symplify/package-builder v8.1.4 Dependency Injection, Console and Kernel toolkit for Symplify packages. symplify/parameter-name-guard v8.1.4 Prevent silent parameter typos that silently break your app symplify/set-config-resolver v8.1.4 Resolve config and sets from configs and cli opptions for CLI applications symplify/smart-file-system v8.1.4 Sanitized FileInfo with safe getRealPath() and other handy methods tracy/tracy v2.7.5 😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, loggin... twig/extra-bundle v3.0.4 A Symfony bundle for extra Twig extensions twig/intl-extra v3.0.4 A Twig extension for Intl twig/twig v3.0.4 Twig, the flexible, fast, and secure template language for PHP vich/uploader-bundle 1.14.0 Ease file uploads attached to entities webmozart/assert 1.9.0 Assertions to validate method input/output with nice error messages. ```

PHP version

$ php -v
PHP 7.3.14 (cli) (built: Jan 27 2020 21:55:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.14, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.14, Copyright (c) 1999-2018, by Zend Technologies
    with blackfire v1.34.3~linux-musl-x64-non_zts73, https://blackfire.io, by Blackfire

Subject

Steps to reproduce

Instanciate a new Symfony 5.1+ app, add 2 or more locales, make at least one entity translatable (with Knp bundle), try to override TranslationFormBundle template. It didn't work

Expected results

Exepected to see my customized template

Actual results

Displayed the default template, even if I set templating: option in the config.

welcoMattic commented 4 years ago

This issue was caused by a misconfig of EasyAdminBundle.

jeremyriverain commented 3 years ago

Hi,

I had the same issue with Easyadmin 3. The template of A2lix didn't show up. In case anyone encounters the same problem, I post my solution here (although this is related to Easyadmin).

You have to add a form theme to the Crud to make it work.

<?php

namespace App\Controller\Admin;

use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;

class DashboardController extends AbstractDashboardController
{
    public function configureCrud(): Crud
    {
        return Crud::new()
            ->addFormTheme('@A2lixTranslationForm/bootstrap_4_layout.html.twig'); // you have to add the A2lix form theme to make it work with the version 3 of Easyadmin
    }
}