sonata-project / SonataCoreBundle

[deprecated] SonataCoreBundle
MIT License
319 stars 139 forks source link

Broken IE compatibility #678

Closed WalterProof closed 5 years ago

WalterProof commented 5 years ago

Environment

Internet Explorer (not Edge)

Sonata packages

$ composer show --latest 'sonata-project/*'
sonata-project/admin-bundle              3.45.2 3.45.2 The missing Symfony Admin Generator
sonata-project/block-bundle              3.14.0 3.14.0 Symfony SonataBlockBundle
sonata-project/cache                     1.1.1  2.0.1  Cache library
sonata-project/cache-bundle              2.4.2  3.0.1  This bundle provides caching services
sonata-project/classification-bundle     3.8.0  3.8.0  Symfony SonataClassificationBundle
sonata-project/core-bundle               3.16.1 3.16.1 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.4.0  2.4.0  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.1.3  1.1.5  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.8.2  3.8.3  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle       2.5.0  2.5.0  Symfony SonataEasyExtendsBundle
sonata-project/exporter                  1.11.0 2.0.1  Lightweight Exporter library
sonata-project/formatter-bundle          3.5.0  4.1.2  Symfony SonataFormatterBundle
sonata-project/google-authenticator      2.2.0  2.2.0  Library to integrate Google Authenticator into a PHP project
sonata-project/intl-bundle               2.5.0  2.5.0  Symfony SonataIntlBundle
sonata-project/media-bundle              3.19.1 3.19.1 Symfony SonataMediaBundle
sonata-project/notification-bundle       3.5.1  3.6.0  Symfony SonataNotificationBundle
sonata-project/page-bundle               3.10.0 3.10.0 This bundle provides a Site and Page management through container and block services
sonata-project/seo-bundle                2.7.0  2.7.0  Symfony SonataSeoBundle
sonata-project/user-bundle               4.3.0  4.3.0  Symfony SonataUserBundle

Symfony packages

$ composer show --latest 'symfony/*'
symfony/contracts             v1.0.2  v1.0.2  A set of abstractions extracted out of the Symfony components
symfony/monolog-bundle        v3.3.1  v3.3.1  Symfony MonologBundle
symfony/phpunit-bridge        v3.4.22 v4.2.3  Symfony PHPUnit Bridge
symfony/polyfill-apcu         v1.10.0 v1.10.0 Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-ctype        v1.10.0 v1.10.0 Symfony polyfill for ctype functions
symfony/polyfill-intl-icu     v1.10.0 v1.10.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring     v1.10.0 v1.10.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php56        v1.10.0 v1.10.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70        v1.10.0 v1.10.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-php72        v1.10.0 v1.10.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-util         v1.10.0 v1.10.0 Symfony utilities for portability of PHP codes
symfony/security-acl          v3.0.1  v3.0.1  Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle    v2.6.7  v3.2.5  Symfony SwiftmailerBundle
symfony/symfony               v3.4.22 v4.2.3  The Symfony PHP framework
symfony/webpack-encore-bundle v1.1.0  v1.1.0  Integration with your Symfony app & Webpack Encore!

PHP version

$ php -v
PHP 7.2.14 (cli) (built: Jan 11 2019 01:42:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.14, Copyright (c) 1999-2018, by Zend Technologies
    with blackfire v1.24.4~linux-musl-x64-non_zts72, https://blackfire.io, by Blackfire

Subject

Bug on Internet Explorer

Steps to reproduce

Following https://sonata-project.org/bundles/core/3-x/doc/reference/flash_messages.html# While using the standard layout, and https://github.com/sonata-project/SonataCoreBundle/blob/3.x/src/CoreBundle/Resources/public/js/base.js As I supposed this is the way to integrate flash messages because it is not documented, Since Sonata 3.15.0, I got an error in my browser console: SCRIPT438: Object doesn't support property or method 'forEach' and all my JS is broken This bug was recently introduced because of this line https://github.com/sonata-project/SonataCoreBundle/commit/c5dfef1337781fb2b1972b92b8ff8ec4f6458c86#diff-8e6b6994ae2ee0f16eacfe0d4dab7aedR45

Expected results

No errors

Actual results

SCRIPT438: Object doesn't support property or method 'forEach'

WalterProof commented 5 years ago

PS: related, shouldn't https://github.com/sonata-project/SonataCoreBundle/blob/3.x/src/CoreBundle/Resources/public/js/base.js be included in https://github.com/sonata-project/SonataAdminBundle/blob/3.x/src/DependencyInjection/Configuration.php ?

core23 commented 5 years ago

Bug on Internet Explorer

Which version?

AFAIK IE is dead. Use a modern browser

WalterProof commented 5 years ago

All version except Edge, see NodeList.forEach support here https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Browser_Compatibility

Sonata is mainly used as a professionnal admin tool, we all know, in enterprise world there can be some inertia concerning tool changing, it's not about the developper but the application users.

core23 commented 5 years ago

If you need IE support, you could use babel if you need support for a legacy browser

core23 commented 5 years ago

Won't fix, because we don't support outdated browsers

IE10+ supports forEach (https://caniuse.com/#search=foreach)