sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

Pagination is applied to exports #4500

Closed Kaijiro closed 4 years ago

Kaijiro commented 7 years ago

Environment

Sonata packages

$ composer show sonata-project/*
sonata-project/admin-bundle              3.13.0 The missing Symfony Admin Generator
sonata-project/block-bundle              3.3.0  Symfony SonataBlockBundle
sonata-project/cache                     1.0.7  Cache library
sonata-project/cache-bundle              2.3.1  This bundle provides caching services
sonata-project/classification-bundle     3.3.0  Symfony SonataClassificationBundle
sonata-project/core-bundle               3.3.0  Symfony SonataCoreBundle
sonata-project/dashboard-bundle          0.1.0  Provides a Dashboard management through container and block services
sonata-project/datagrid-bundle           2.2.1  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.0.2  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.1.3  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle       2.1.10 Symfony SonataEasyExtendsBundle
sonata-project/exporter                  1.7.1  Lightweight Exporter library
sonata-project/formatter-bundle          3.1.0  Symfony SonataFormatterBundle
sonata-project/google-authenticator      1.0.2  Library to integrate Google Authenticator into a PHP project
sonata-project/intl-bundle               2.3.0  Symfony SonataIntlBundle
sonata-project/media-bundle              3.3.1  Symfony SonataMediaBundle
sonata-project/notification-bundle       3.1.0  Symfony SonataNotificationBundle
sonata-project/page-bundle               3.3.0  This bundle provides a Site and Page management through container and block services
sonata-project/seo-bundle                2.1.0  Symfony SonataSeoBundle
sonata-project/user-bundle               3.2.1  Symfony SonataUserBundle

Symfony packages

$ composer show symfony/*
symfony/monolog-bundle     v2.8.0  Symfony MonologBundle
symfony/phpunit-bridge     v3.2.4  Symfony PHPUnit Bridge
symfony/polyfill-apcu      v1.1.0  Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu  v1.3.0  Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring  v1.3.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php54     v1.3.0  Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions
symfony/polyfill-php55     v1.3.0  Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions
symfony/polyfill-php56     v1.3.0  Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70     v1.3.0  Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util      v1.3.0  Symfony utilities for portability of PHP codes
symfony/security-acl       v3.0.0  Symfony Security Component - ACL (Access Control List)
symfony/security-bundle    v2.3.0  Symfony SecurityBundle
symfony/swiftmailer-bundle v2.4.2  Symfony SwiftmailerBundle
symfony/symfony            v2.8.17 The Symfony PHP framework
symfony/var-dumper         v3.2.3  Symfony mechanism for exploring and dumping PHP variables

PHP version

$ php -v
PHP 7.0.19-1+deb.sury.org~xenial+1 (cli) (built: May 11 2017 14:06:14) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
    with Zend OPcache v7.0.19-1+deb.sury.org~xenial+1, Copyright (c) 1999-2017, by Zend Technologies

Subject

When creating a custom admin and doing an export, the pagination is applied in the export result : only the viewed page is exported instead of the whole set of result.

When applying filters and exporting, users often expect to retrieve the whole set of results in the CSV lines.

OskarStark commented 7 years ago

IMO this is the expected behavior.

WDYT @greg0ire ?

greg0ire commented 7 years ago

Not a bug indeed, but it would be great to have a config node for this.

OskarStark commented 7 years ago

or a second button? or changing the button name when selecting some rows?

"Export" -> "Export selection" ?

greg0ire commented 7 years ago

Exporting the selection would be another feature. Right now, it exports the current filtered page, there should be an option or a button to export all rows matching the current filter.

Kaijiro commented 7 years ago

I agree with you @greg0ire, it is not really intuitive to have ONLY the current filtered page. Maybe we should have both export available, I don't really know how ...

jordisala1991 commented 6 years ago

IMO not a bug, if any, this could be consider an enhancement or a new feature

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

VincentLanglet commented 4 years ago

@OskarStark @greg0ire @jordisala1991 If I understand correctly your messages, you say that if there is 3 pages of 16 results on my list and I'm on page 1 when clicking export, I'll get only the first 16 results ?

On my project I get all the 48 results when i'm exporting (but I don't know if we've overriden something for that). So It seems like the behaviour changed (in a more intuitive way IMO) and we can maybe close the issue (?)