Closed RicoLLFDL closed 3 years ago
I can confirm this bug.
{
"require": {
"php": "^7.4",
"ext-ctype": "*",
"ext-iconv": "*",
"sonata-project/admin-bundle": "dev-master#c8fc9cc6fc0ad08a2f6fc56bfb644e72f7fe033e",
"sonata-project/doctrine-mongodb-admin-bundle": "dev-master",
"sonata-project/exporter": "^2.5",
"symfony/apache-pack": "^1.0",
"symfony/console": "5.2.*",
"symfony/dotenv": "5.2.*",
"symfony/flex": "^1.3.1",
"symfony/framework-bundle": "5.2.*",
"symfony/yaml": "5.2.*"
},
For the used commit please see:
I also downgraded to symfony 4 but the issue still exists:
{
"require": {
"php": "^7.4",
"ext-ctype": "*",
"ext-iconv": "*",
"sonata-project/admin-bundle": "^3.93",
"sonata-project/doctrine-mongodb-admin-bundle": "^3.7",
"symfony/apache-pack": "^1.0",
"symfony/dotenv": "4.4.*",
"symfony/flex": "^1.12",
"symfony/framework-bundle": "4.4.*",
"symfony/yaml": "4.4.*"
},
Maybe @franmomu can help on this, does it work for you ?
I tried some older releases.
< 2.4.0 the error would be:
Attempted to call an undefined method named "iterate" of class "Doctrine\ODM\MongoDB\Query\Query".
Since >= 2.4.0 we get the current message.
Hope this helps.
Environment
Sonata packages
show
``` $ composer show --latest 'sonata-project/*' sonata-project/admin-bundle 3.88.0 3.89.1 The missing Symfony Admin Generator sonata-project/block-bundle 4.5.0 4.5.0 Symfony SonataBlockBundle sonata-project/cache 2.0.1 2.1.1 Cache library sonata-project/doctrine-extensions 1.11.0 1.11.0 Doctrine2 behavioral extensions sonata-project/doctrine-mongodb-admin-bundle 3.7.0 3.7.0 Symfony Sonata / Integrate Doctrine MongoDB ODM into the SonataAdminBundle sonata-project/doctrine-orm-admin-bundle 3.29.0 3.29.0 Integrate Doctrine ORM into the SonataAdminBundle sonata-project/exporter 2.5.1 2.5.1 Lightweight Exporter library sonata-project/form-extensions 1.9.0 1.9.0 Symfony form extensions sonata-project/twig-extensions 1.5.1 1.5.1 Sonata twig extensions ```
Symfony packages
show
``` $ composer show --latest 'symfony/*' symfony/asset v4.4.8 v5.2.3 Symfony Asset Component symfony/browser-kit v4.4.8 v5.2.3 Symfony BrowserKit Component symfony/cache v4.4.8 v5.2.3 Symfony Cache component with PSR-6, PSR-16, and tags symfony/cache-contracts v2.0.1 v2.2.0 Generic abstractions related to caching symfony/config v4.4.17 v5.2.3 Symfony Config Component symfony/console v4.4.8 v5.2.3 Symfony Console Component symfony/css-selector v4.4.8 v5.2.3 Symfony CssSelector Component symfony/debug v4.4.8 v4.4.19 Symfony Debug Component symfony/debug-bundle v4.4.8 v5.2.3 Symfony DebugBundle symfony/debug-pack v1.0.8 v1.0.9 A debug pack for Symfony projects symfony/dependency-injection v4.4.17 v5.2.3 Symfony DependencyInjection Component symfony/deprecation-contracts v2.2.0 v2.2.0 A generic function and convention to trigger deprecation notices symfony/doctrine-bridge v4.4.8 v5.2.3 Symfony Doctrine Bridge symfony/dom-crawler v4.4.8 v5.2.3 Symfony DomCrawler Component symfony/dotenv v4.4.8 v5.2.3 Registers environment variables from a .env file symfony/error-handler v4.4.8 v5.2.3 Symfony ErrorHandler Component symfony/event-dispatcher v4.4.8 v5.2.3 Symfony EventDispatcher Component symfony/event-dispatcher-contracts v1.1.7 v2.2.0 Generic abstractions related to dispatching event symfony/expression-language v4.4.8 v5.2.3 Symfony ExpressionLanguage Component symfony/filesystem v4.4.17 v5.2.3 Symfony Filesystem Component symfony/finder v4.4.8 v5.2.3 Symfony Finder Component symfony/flex v1.9.5 v1.12.2 Composer plugin for Symfony symfony/form v4.4.19 v5.2.3 Allows to easily create, process and reuse HTML forms symfony/framework-bundle v4.4.8 v5.2.3 Symfony FrameworkBundle symfony/http-client v4.4.8 v5.2.3 Symfony HttpClient component symfony/http-client-contracts v2.0.1 v2.3.1 Generic abstractions related to HTTP clients symfony/http-foundation v4.4.8 v5.2.3 Symfony HttpFoundation Component symfony/http-kernel v4.4.13 v5.2.3 Symfony HttpKernel Component symfony/inflector v4.4.8 v5.2.3 Symfony Inflector Component symfony/intl v4.4.8 v5.2.3 A PHP replacement layer for the C intl extension that includes additional data from the ICU library. symfony/lock v4.4.8 v5.2.3 Symfony Lock Component symfony/mailer v4.4.8 v5.2.3 Symfony Mailer Component symfony/maker-bundle v1.15.1 v1.29.1 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forge... symfony/messenger v4.4.8 v5.2.3 Symfony Messenger Component symfony/mime v4.4.13 v5.2.3 A library to manipulate MIME messages symfony/monolog-bridge v4.4.8 v5.2.3 Symfony Monolog Bridge symfony/monolog-bundle v3.5.0 v3.6.0 Symfony MonologBundle symfony/options-resolver v4.4.11 v5.2.3 Symfony OptionsResolver Component symfony/orm-pack v1.0.8 v2.1.0 A pack for the Doctrine ORM symfony/polyfill-ctype v1.20.0 v1.22.1 Symfony polyfill for ctype functions symfony/polyfill-intl-grapheme v1.15.0 v1.22.1 Symfony polyfill for intl's grapheme_* functions symfony/polyfill-intl-icu v1.15.0 v1.22.1 Symfony polyfill for intl's ICU-related data and classes symfony/polyfill-intl-idn v1.15.0 v1.22.1 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions symfony/polyfill-intl-normalizer v1.15.0 v1.22.1 Symfony polyfill for intl's Normalizer class and related functions symfony/polyfill-mbstring v1.15.0 v1.22.1 Symfony polyfill for the Mbstring extension symfony/polyfill-php72 v1.15.0 v1.22.1 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions symfony/polyfill-php73 v1.15.0 v1.22.1 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions symfony/polyfill-php80 v1.18.1 v1.22.1 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions symfony/process v4.4.8 v5.2.3 Symfony Process Component symfony/profiler-pack v1.0.4 v1.0.5 A pack for the Symfony web profiler symfony/property-access v4.4.8 v5.2.3 Symfony PropertyAccess Component symfony/property-info v4.4.11 v5.2.3 Symfony Property Info Component symfony/psr-http-message-bridge v1.3.0 v2.1.0 PSR HTTP message bridge symfony/routing v4.4.8 v5.2.3 Symfony Routing Component symfony/security-acl v3.1.1 v3.1.1 Symfony Security Component - ACL (Access Control List) symfony/security-bundle v4.4.8 v5.2.3 Symfony SecurityBundle symfony/security-core v4.4.8 v5.2.3 Symfony Security Component - Core Library symfony/security-csrf v4.4.8 v5.2.3 Symfony Security Component - CSRF Library symfony/security-guard v4.4.8 v5.2.3 Symfony Security Component - Guard symfony/security-http v4.4.8 v5.2.3 Symfony Security Component - HTTP Integration symfony/serializer v4.4.11 v5.2.3 Symfony Serializer Component symfony/serializer-pack v1.0.3 v1.0.4 A pack for the Symfony serializer symfony/service-contracts v2.2.0 v2.2.0 Generic abstractions related to writing services symfony/stopwatch v4.4.8 v5.2.3 Symfony Stopwatch Component symfony/string v5.2.3 v5.2.3 Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters ... symfony/templating v4.4.8 v5.2.3 Symfony Templating Component symfony/translation v4.4.8 v5.2.3 Symfony Translation Component symfony/translation-contracts v2.0.1 v2.3.0 Generic abstractions related to translation symfony/twig-bridge v4.4.8 v5.2.3 Symfony Twig Bridge symfony/twig-bundle v4.4.8 v5.2.3 Symfony TwigBundle symfony/twig-pack v1.0.0 v1.0.1 A Twig pack for Symfony projects symfony/validator v4.4.8 v5.2.3 Symfony Validator Component symfony/var-dumper v4.4.8 v5.2.3 Symfony mechanism for exploring and dumping PHP variables symfony/var-exporter v4.4.8 v5.2.3 A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code symfony/web-profiler-bundle v4.4.8 v5.2.3 Symfony WebProfilerBundle symfony/webpack-encore-bundle v1.7.3 v1.11.1 Integration with your Symfony app & Webpack Encore! symfony/workflow v4.4.8 v5.2.3 Symfony Workflow Component symfony/yaml v4.4.8 v5.2.3 Symfony Yaml Component ```
PHP version
Subject
When exporting data from mongodb in Sonata Admin, the file got is filled by Symfony error. The DoctrineODMQuerySourceIterator got an object instead of an array.
Minimal repository with the bug
Steps to reproduce
In Sonata Admin, go to a list of mongodb records. Export the list (whatever the format).
Expected results
Data are exported in desired format.
Actual results
The file is available, but with a Symfony error in it.