{"action":"created","issue":{"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/5005","repository_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle","labels_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/5005/labels{/name}","comments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/5005/comments","events_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/5005/events","html_url":"https://github.com/sonata-project/SonataAdminBundle/issues/5005","id":303584505,"number":5005,"title":"Can not use `DateType::class` as second argument for `ListMapper::add()`","user":{"login":"phansys","id":1231441,"avatar_url":"https://avatars0.githubusercontent.com/u/1231441?v=4","gravatar_id":"","url":"https://api.github.com/users/phansys","html_url":"https://github.com/phansys","followers_url":"https://api.github.com/users/phansys/followers","following_url":"https://api.github.com/users/phansys/following{/other_user}","gists_url":"https://api.github.com/users/phansys/gists{/gist_id}","starred_url":"https://api.github.com/users/phansys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phansys/subscriptions","organizations_url":"https://api.github.com/users/phansys/orgs","repos_url":"https://api.github.com/users/phansys/repos","events_url":"https://api.github.com/users/phansys/events{/privacy}","received_events_url":"https://api.github.com/users/phansys/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-08T18:31:26Z","updated_at":"2018-03-10T23:50:52Z","closed_at":"2018-03-08T20:30:41Z","author_association":"CONTRIBUTOR","body":"### Environment\r\n\r\n#### Sonata packages\r\n\r\n```\r\n$ composer show --latest 'sonata-project/*'\r\nsonata-project/admin-bundle              3.31.1 3.32.0 The missing Symfony Admin Generator\r\nsonata-project/block-bundle              3.12.0 3.12.0 Symfony SonataBlockBundle\r\nsonata-project/cache                     2.0.1  2.0.1  Cache library\r\nsonata-project/core-bundle               3.9.1  3.9.1  Symfony SonataCoreBundle\r\nsonata-project/datagrid-bundle           2.3.1  2.3.1  Symfony SonataDatagridBundle\r\nsonata-project/doctrine-extensions       1.0.2  1.0.2  Doctrine2 behavioral extensions\r\nsonata-project/doctrine-orm-admin-bundle 3.4.2  3.4.2  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle\r\nsonata-project/easy-extends-bundle       2.5.0  2.5.0  Symfony SonataEasyExtendsBundle\r\nsonata-project/exporter                  1.8.0  1.8.0  Lightweight Exporter library\r\nsonata-project/intl-bundle               2.4.0  2.4.0  Symfony SonataIntlBundle\r\nsonata-project/media-bundle              3.11.0 3.11.0 Symfony SonataMediaBundle\r\nsonata-project/notification-bundle       3.4.0  3.4.0  Symfony SonataNotificationBundle\r\nsonata-project/user-bundle               4.1.1  4.1.1  Symfony SonataUserBundle\r\n```\r\n\r\n#### Symfony packages\r\n\r\n```\r\n$ composer show --latest 'symfony/*'\r\nsymfony/assetic-bundle     v2.8.2 v2.8.2 Integrates Assetic into Symfony2\r\nsymfony/monolog-bundle     v3.2.0 v3.2.0 Symfony MonologBundle\r\nsymfony/phpunit-bridge     v4.0.5 v4.0.6 Symfony PHPUnit Bridge\r\nsymfony/polyfill-apcu      v1.7.0 v1.7.0 Symfony polyfill backporting apcu_* functions to lower PHP versions\r\nsymfony/polyfill-intl-icu  v1.7.0 v1.7.0 Symfony polyfill for intl's ICU-related data and classes\r\nsymfony/polyfill-mbstring  v1.7.0 v1.7.0 Symfony polyfill for the Mbstring extension\r\nsymfony/polyfill-php56     v1.7.0 v1.7.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions\r\nsymfony/polyfill-php70     v1.7.0 v1.7.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions\r\nsymfony/polyfill-php72     v1.7.0 v1.7.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions\r\nsymfony/polyfill-util      v1.7.0 v1.7.0 Symfony utilities for portability of PHP codes\r\nsymfony/security-acl       v3.0.1 v3.0.1 Symfony Security Component - ACL (Access Control List)\r\nsymfony/swiftmailer-bundle v2.6.7 v3.2.1 Symfony SwiftmailerBundle\r\nsymfony/symfony            v3.4.6 v4.0.6 The Symfony PHP framework\r\n```\r\n\r\n#### PHP version\r\n\r\n```\r\n$ php -v\r\n7.2.2\r\n```\r\n\r\n## Subject\r\n\r\nCan not use `DateType::class` as second argument for `ListMapper::add()`\r\n\r\n## Steps to reproduce\r\n`ListMapper::add('property-name-representing-a-datetime-object', \\Symfony\\Component\\Form\\Extension\\Core\\Type\\DateType::class);`\r\n## Expected results\r\n\r\nI expect the date object to be printed with the configured format at `base_list_field.html.twig` (`{% set data_value = value.format('Y-m-d') %}`\r\n\r\n## Actual results\r\n\r\n```\r\nAn exception has been thrown during the rendering of a template (\"Catchable Fatal Error: Object of class DateTime could not be converted to string\").\r\n\r\nin vendor/sonata-project/admin-bundle/src/Resources/views/CRUD/base_list_field.html.twig (line 31)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/comments/372076827","html_url":"https://github.com/sonata-project/SonataAdminBundle/issues/5005#issuecomment-372076827","issue_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/5005","id":372076827,"user":{"login":"phansys","id":1231441,"avatar_url":"https://avatars0.githubusercontent.com/u/1231441?v=4","gravatar_id":"","url":"https://api.github.com/users/phansys","html_url":"https://github.com/phansys","followers_url":"https://api.github.com/users/phansys/followers","following_url":"https://api.github.com/users/phansys/following{/other_user}","gists_url":"https://api.github.com/users/phansys/gists{/gist_id}","starred_url":"https://api.github.com/users/phansys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phansys/subscriptions","organizations_url":"https://api.github.com/users/phansys/orgs","repos_url":"https://api.github.com/users/phansys/repos","events_url":"https://api.github.com/users/phansys/events{/privacy}","received_events_url":"https://api.github.com/users/phansys/received_events","type":"User","site_admin":false},"created_at":"2018-03-10T23:50:52Z","updated_at":"2018-03-10T23:50:52Z","author_association":"CONTRIBUTOR","body":"Thank you for pointing :+1: I'll try to create a PR with the mentioned clarification soon."}}
{"actor":{"display_login":"phansys"}}