Sonataadminbundle: CRC32 - crash jQuery/Ajax files

Created on 28 Aug 2018  路  2Comments  路  Source: sonata-project/SonataAdminBundle

Environment

Sonata packages

sonata-project/admin-bundle              3.38.3 = 3.38.3 The missing Symfony Admin Generator
sonata-project/block-bundle              3.12.1 = 3.12.1 Symfony SonataBlockBundle
sonata-project/cache                     1.1.1  ~ 2.0.1  Cache library
sonata-project/cache-bundle              2.4.2  ~ 3.0.0  This bundle provides caching services
sonata-project/core-bundle               3.11.2 = 3.11.2 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.3.1  = 2.3.1  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.0.2  = 1.0.2  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.6.1  = 3.6.1  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.9.1  = 1.9.1  Lightweight Exporter library
sonata-project/media-bundle              3.15.0 = 3.15.0 Symfony SonataMediaBundle
sonata-project/notification-bundle       3.5.1  = 3.5.1  Symfony SonataNotificationBundle
sonata-project/page-bundle               3.9.0  = 3.9.0  This bundle provides a Site and Page management through container and block services
sonata-project/seo-bundle                2.6.0  = 2.6.0  Symfony SonataSeoBundle
sonata-project/user-bundle               4.2.3  = 4.2.3  Symfony SonataUserBundle

Symfony packages

symfony/asset                v4.1.3             = v4.1.3             Symfony Asset Component
symfony/browser-kit          v4.1.3             = v4.1.3             Symfony BrowserKit Component
symfony/cache                v4.1.3             = v4.1.3             Symfony Cache component with PSR-6, PSR-16, and tags
symfony/class-loader         v3.4.14            = v3.4.14            Symfony ClassLoader Component
symfony/config               v4.1.3             = v4.1.3             Symfony Config Component
symfony/console              v4.1.3             = v4.1.3             Symfony Console Component
symfony/css-selector         v4.1.3             = v4.1.3             Symfony CssSelector Component
symfony/debug                v4.1.3             = v4.1.3             Symfony Debug Component
symfony/debug-bundle         v4.1.3             = v4.1.3             Symfony DebugBundle
symfony/debug-pack           v1.0.6             = v1.0.6             A debug pack for Symfony projects
symfony/dependency-injection v4.1.3             = v4.1.3             Symfony DependencyInjection Component
symfony/doctrine-bridge      v4.1.3             = v4.1.3             Symfony Doctrine Bridge
symfony/dom-crawler          v4.1.3             = v4.1.3             Symfony DomCrawler Component
symfony/dotenv               v4.1.3             = v4.1.3             Registers environment variables from a .env file
symfony/event-dispatcher     v4.1.3             = v4.1.3             Symfony EventDispatcher Component
symfony/expression-language  v4.1.3             = v4.1.3             Symfony ExpressionLanguage Component
symfony/filesystem           v4.1.3             = v4.1.3             Symfony Filesystem Component
symfony/finder               v4.1.3             = v4.1.3             Symfony Finder Component
symfony/flex                 v1.1.0             = v1.1.0             Composer plugin for Symfony
symfony/form                 v4.1.3             = v4.1.3             Symfony Form Component
symfony/framework-bundle     v4.1.3             = v4.1.3             Symfony FrameworkBundle
symfony/http-foundation      v4.1.3             = v4.1.3             Symfony HttpFoundation Component
symfony/http-kernel          v4.1.3             = v4.1.3             Symfony HttpKernel Component
symfony/inflector            v4.1.3             = v4.1.3             Symfony Inflector Component
symfony/intl                 v4.1.3             = v4.1.3             A PHP replacement layer for the C intl extension that includes additional data from the ICU library.
symfony/lts                  dev-master 6de50b2 = dev-master 6de50b2 Enforces Long Term Supported versions of Symfony components
symfony/maker-bundle         v1.6.0             = v1.6.0             Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.
symfony/monolog-bridge       v4.1.3             = v4.1.3             Symfony Monolog Bridge
symfony/monolog-bundle       v3.3.0             = v3.3.0             Symfony MonologBundle
symfony/options-resolver     v4.1.3             = v4.1.3             Symfony OptionsResolver Component
symfony/orm-pack             v1.0.5             = v1.0.5             A pack for the Doctrine ORM
symfony/phpunit-bridge       v4.1.3             = v4.1.3             Symfony PHPUnit Bridge
symfony/polyfill-ctype       v1.9.0             = v1.9.0             Symfony polyfill for ctype functions
symfony/polyfill-intl-icu    v1.9.0             = v1.9.0             Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring    v1.9.0             = v1.9.0             Symfony polyfill for the Mbstring extension
symfony/polyfill-php72       v1.9.0             = v1.9.0             Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/process              v4.1.3             = v4.1.3             Symfony Process Component
symfony/profiler-pack        v1.0.3             = v1.0.3             A pack for the Symfony web profiler
symfony/property-access      v4.1.3             = v4.1.3             Symfony PropertyAccess Component
symfony/property-info        v4.1.3             = v4.1.3             Symfony Property Info Component
symfony/routing              v4.1.3             = v4.1.3             Symfony Routing Component
symfony/security             v4.1.3             = v4.1.3             Symfony Security Component
symfony/security-acl         v3.0.1             = v3.0.1             Symfony Security Component - ACL (Access Control List)
symfony/security-bundle      v4.1.3             = v4.1.3             Symfony SecurityBundle
symfony/serializer           v4.1.3             = v4.1.3             Symfony Serializer Component
symfony/serializer-pack      v1.0.1             = v1.0.1             A pack for the Symfony serializer
symfony/stopwatch            v4.1.3             = v4.1.3             Symfony Stopwatch Component
symfony/swiftmailer-bundle   v3.2.2             = v3.2.2             Symfony SwiftmailerBundle
symfony/templating           v4.1.3             = v4.1.3             Symfony Templating Component
symfony/test-pack            v1.0.2             = v1.0.2             A pack for functional testing within a Symfony app
symfony/translation          v4.1.3             = v4.1.3             Symfony Translation Component
symfony/twig-bridge          v4.1.3             = v4.1.3             Symfony Twig Bridge
symfony/twig-bundle          v4.1.3             = v4.1.3             Symfony TwigBundle
symfony/validator            v4.1.3             = v4.1.3             Symfony Validator Component
symfony/var-dumper           v4.1.3             = v4.1.3             Symfony mechanism for exploring and dumping PHP variables
symfony/web-link             v4.1.3             = v4.1.3             Symfony WebLink Component
symfony/web-profiler-bundle  v4.1.3             = v4.1.3             Symfony WebProfilerBundle
symfony/web-server-bundle    v4.1.3             = v4.1.3             Symfony WebServerBundle
symfony/yaml                 v4.1.3             = v4.1.3             Symfony Yaml Component

PHP version

PHP 7.2.7 (cli) (built: Jun 19 2018 23:43:47) ( ZTS MSVC15 (Visual C++ 2017) x86 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Subject

(sorry for my English)

The problem appeared after changes from: #5176 and refer to crc32.

crc32: "Because PHP's integer type is signed many crc32 checksums will result in negative integers on 32bit platforms. On 64bit installations all crc32() results will be positive integers though."

In many cases, this function returns me a negative uniqueid (for example: when i try add new media to gallery). When I have negative uniqueid, i have error in jQuery files: "Unexpected token -". This error crash my forms in admin classes.

If uniqueid starts with 's-' then the jQuery files display this error and dialog box does not open...

Actual results

For example, I want to add new gallery with new images. So, I go to GalleryAdmin:
https://imgur.com/a/fyQPuXf

When I click "add new", redirected me to antoher page (dialog box should be open not redirected...):
https://imgur.com/a/52JQBak

Please check url. Values of the uniqueids are less than 0.

Expected results

This is the same project but other admin class. Value of uniqueid is greater than 0 and dialog box is open:
https://imgur.com/a/0b23s6t

Most helpful comment

Sure will have a look this afternoon !

All 2 comments

@EmmanuelVella can you please help?

Sure will have a look this afternoon !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vazgen picture vazgen  路  4Comments

tiagojsag picture tiagojsag  路  4Comments

core23 picture core23  路  3Comments

aglemakinafr picture aglemakinafr  路  4Comments

peter-gribanov picture peter-gribanov  路  3Comments