Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-24826

Integer/Float fields do not raise an error/warning with big numbers (>2^64)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2015.09, 1.7.0, 1.7.1, 1.8.0, 1.7.2, 1.9.0-rc
    • Fix Version/s: QA tracked issues, 1.7.4-rc, 1.10.0
    • Labels:
    • Environment:

      Operating System: CentOS 7.0 x64
      PHP Version: 5.4.16
      Database and version: Mariadb 5.5
      Browser (and version): Firefox 39

      Description

      Creating a content that has an integer/float fieldtype, filling in the integer/float field with an large integer (bigger than 2^64), allows the content to be published but the integer/float field is published with an empty value (no warning was given regarding the impossibility of saving such a big number).

      Steps to Reproduce

      – Create a contentType with a float or an integer fieldtype
      – Create a content of the previous created content type
      – Fill in the integer/float field with: 1234567890123456789012345678901234567901234567890123456789012345678901234567890123456790123456789012345678901234567890123456789012345679012345678901234567890123456789012345678901234567901234567890123456789012345678901234567890123456790123456789012345678901234567890123456789012345679012345678901234567890123456789012345678901234567901234567890123456789012345678901234567890123456790123456789012345678901234567890123456789012345679012345678901234567890123456789012345678901234567901234567890
      – publish the content

      When viewing the content, the integer/float field is set to "This field is empty".
      This happens even if the filed is defined as "required"

      In firebug, I have:

      {"ErrorMessage":{"_media-type":"application\/vnd.ez.api.ErrorMessage+json","errorCode":406,"errorMessage"
      :"Not Acceptable","errorDescription":"Argument '$value->value' is invalid: expected value to be of type
       'integer', got 'double'","trace":"#0 \/var\/www\/html\/ezpublish5\/vendor\/ezsystems\/ezpublish-kernel
      \/eZ\/Publish\/Core\/FieldType\/FieldType.php(391): eZ\\Publish\\Core\\FieldType\\Integer\\Type->checkValueStructure
      (Object(eZ\\Publish\\Core\\FieldType\\Integer\\Value))\n#1 \/var\/www\/html\/ezpublish5\/vendor\/ezsystems
      \/ezpublish-kernel\/eZ\/Publish\/Core\/Repository\/ContentService.php(563): eZ\\Publish\\Core\\FieldType
      \\FieldType->acceptValue(Object(eZ\\Publish\\Core\\FieldType\\Integer\\Value))\n#2 \/var\/www\/html\
      /ezpublish5\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/SignalSlot\/ContentService.php(241
      ): eZ\\Publish\\Core\\Repository\\ContentService->createContent(Object(eZ\\Publish\\Core\\Repository
      \\Values\\Content\\ContentCreateStruct), Array)\n#3 \/var\/www\/html\/ezpublish5\/vendor\/ezsystems\
      /ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Controller\/Content.php(246): eZ\\Publish\\Core\
      \SignalSlot\\ContentService->createContent(Object(eZ\\Publish\\Core\\Repository\\Values\\Content\\ContentCreateStruct
      ), Array)\n#4 [internal function]: eZ\\Publish\\Core\\REST\\Server\\Controller\\Content->createContent
      (Object(Symfony\\Component\\HttpFoundation\\Request))\n#5 \/var\/www\/html\/ezpublish5\/ezpublish\/bootstrap
      .php.cache(3109): call_user_func_array(Array, Array)\n#6 \/var\/www\/html\/ezpublish5\/ezpublish\/bootstrap
      .php.cache(3071): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation
      \\Request), 1)\n#7 \/var\/www\/html\/ezpublish5\/ezpublish\/bootstrap.php.cache(3222): Symfony\\Component
      \\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#8 \
      /var\/www\/html\/ezpublish5\/ezpublish\/bootstrap.php.cache(2444): Symfony\\Component\\HttpKernel\\DependencyInjection
      \\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#9
       \/var\/www\/html\/ezpublish5\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpCache
      \/HttpCache.php(493): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation
      \\Request), 1, true)\n#10 \/var\/www\/html\/ezpublish5\/vendor\/symfony\/symfony\/src\/Symfony\/Bundle
      \/FrameworkBundle\/HttpCache\/HttpCache.php(60): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache-
      >forward(Object(Symfony\\Component\\HttpFoundation\\Request), true, NULL)\n#11 \/var\/www\/html\/ezpublish5
      \/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpCache\/HttpCache.php(264): Symfony
      \\Bundle\\FrameworkBundle\\HttpCache\\HttpCache->forward(Object(Symfony\\Component\\HttpFoundation\\Request
      ), true)\n#12 \/var\/www\/html\/ezpublish5\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel
      \/HttpCache\/HttpCache.php(281): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->pass(Object(Symfony
      \\Component\\HttpFoundation\\Request), true)\n#13 \/var\/www\/html\/ezpublish5\/vendor\/friendsofsymfony
      \/http-cache-bundle\/SymfonyCache\/EventDispatchingHttpCache.php(161): Symfony\\Component\\HttpKernel
      \\HttpCache\\HttpCache->invalidate(Object(Symfony\\Component\\HttpFoundation\\Request), true)\n#14 \
      /var\/www\/html\/ezpublish5\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Bundle\/EzPublishCoreBundle\/HttpCache
      .php(39): FOS\\HttpCacheBundle\\SymfonyCache\\EventDispatchingHttpCache->invalidate(Object(Symfony\\Component
      \\HttpFoundation\\Request), true)\n#15 \/var\/www\/html\/ezpublish5\/vendor\/symfony\/symfony\/src\/Symfony
      \/Component\/HttpKernel\/HttpCache\/HttpCache.php(210): eZ\\Bundle\\EzPublishCoreBundle\\HttpCache->invalidate
      (Object(Symfony\\Component\\HttpFoundation\\Request), true)\n#16 \/var\/www\/html\/ezpublish5\/vendor
      \/friendsofsymfony\/http-cache-bundle\/SymfonyCache\/EventDispatchingHttpCache.php(122): Symfony\\Component
      \\HttpKernel\\HttpCache\\HttpCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true
      )\n#17 \/var\/www\/html\/ezpublish5\/web\/index.php(66): FOS\\HttpCacheBundle\\SymfonyCache\\EventDispatchingHttpCache-
      >handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#18 {main}","file":"\/var\/www\/html\/ezpublish5
      \/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/FieldType\/Integer\/Type.php","line":225}}
      
      "NetworkError: 406 Not Acceptable - http://ezp5.paulo/api/ezp/v2/content/objects"
      objects
      TypeError: response.document.Content is undefined
      	
      
      ...n.setAttrs(version.parse({document: response.document.Content.CurrentVersion}))
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                paulo.nunes-obsolete@ez.no Paulo Nunes (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: