symfony / recipes-contrib

Symfony Contrib Recipes Repositories
https://github.com/symfony/recipes-contrib/blob/flex/main/RECIPES.md
MIT License
527 stars 632 forks source link

In ArrayNode.php line 331: Unrecognized option "xml" under "jms_serializer.visitors". Available option s are "json_deserialization", "json_serialization", "xml_deserialization", "xml_serialization". #674

Closed Pasuvan closed 5 years ago

Pasuvan commented 5 years ago

Once I upgraded Symfony3.4 to flex above issue happening, please anyone help on me. Thanks

bocharsky-bw commented 5 years ago

The error message is pretty clear - you have an invalid configuration. Please, see the config reference and compare it with your current configuration: https://jmsyst.com/bundles/JMSSerializerBundle/master/configuration#extension-reference - as you can see there's no xml option under jms_serializer.visitors

Pasuvan commented 5 years ago

@bocharsky-bw Here I added my config snippet here Please review it and resolved it.

jms_serializer:
   handlers:
       datetime:
           default_format: "Y-m-d\\TH:i:sP" # ATOM
           default_timezone: "UTC" # defaults to whatever timezone set in php.ini or via date_default_timezone_set
       array_collection:
           initialize_excluded: false    subscribers:
       doctrine_proxy:
           initialize_virtual_types: false
           initialize_excluded: false    object_constructors:
       doctrine:
           fallback_strategy: "null" # possible values ("null" | "exception" | "fallback")    property_naming:
       id: ~
       separator:  _
       lower_case: true    metadata:
       cache: file
       debug: "%kernel.debug%"
       file_cache:
           dir: "%kernel.cache_dir%/serializer"        auto_detection: true        # if you don't want to use auto-detection, you can also define the
       # namespace prefix and the corresponding directory explicitly
       directories:
           picayune_domain:
              namespace_prefix: "Abcd\\AcdBundle"
              path: "@Abcd/AcdBundle/Resources/config/serializer"
       warmup:
           # list of directories to scan searching for php classes to use when warming up the cache
           paths:
               included: []
               excluded: []    expression_evaluator:
       id: jms_serializer.expression_evaluator # auto detected    default_context:
       serialization:
           serialize_null: false
           version: ~
           attributes: {}
           groups: ['Default']
           enable_max_depth_checks: false
       deserialization:
           serialize_null: false
           version: ~
           attributes: {}
           groups: ['Default']
           enable_max_depth_checks: false    visitors:
       json_serialization:
           depth: 512
       json_deserialization:
       xml_serialization:
           format_output: false
           version: "1.0"
           encoding: "UTF-8"
           default_root_name: "result"
           default_root_ns: null
       xml_deserialization:
           external_entities: false
           doctype_whitelist:
               - '<!DOCTYPE authorized SYSTEM "http://some_url">' # an authorized document type for xml deserialization
bocharsky-bw commented 5 years ago

Please, search for visitors - it should be on the next line. The same for auto_detection probably. And I'd recommend you to fix your indentation - use 4 spaces.

Looks like the problem does not relate to this repository, please, open the issue in https://github.com/schmittjoh/JMSSerializerBundle instead if you still have this problem

xabbuh commented 5 years ago

Maybe you also updated JMSSerializerBundle from 2.x to 3.x at the same time without updating your config. The recipe for 2.x ships with a config that seems to trigger this when used with 3.x.

Pasuvan commented 5 years ago

@xabbuh Once I upgraded Symfony 3.4 to Flex. recipe for 3.x was automatically added related config and other folders in "jms_serializer.yaml".

bocharsky-bw commented 5 years ago

I suppose JMSSerializerBundle was upgraded to the latest 3.x version as well, you can check what version is installed with composer info jms/serializer-bundle. When you did composer up - it depends on what constraints you had in compose.json for jms/serializer-bundle, e.g. "jms/serializer-bundle": "^2.3.0"

Pasuvan commented 5 years ago

@bocharsky-bw I have downgraded to latest "jms/serializer-bundle": 3.x to 1.2.0, But now have below issue

In ArrayNode.php line 331: Unrecognized option "array_collection" under "jms_serializer.handlers". Available option is "datetime".

bocharsky-bw commented 5 years ago

Please, try to find all the files that have the configuration for JmsSerializerBundle, literally, all the files that have jms_serializer: key and remove all of them except the only one you had before the upgrade. So, basically, you just need to keep the only one configuration you had before the unintentional upgrade of jms/serializer-bundle to 3.x.

Though, it depends if you changed your jms_serializer config after upgrade or no

goetas commented 5 years ago

@Pasuvan please run composer info providing which bundle version are you using

Pasuvan commented 5 years ago

@goetas Lot of bundles available in my composer, Please review it.

apoutchika/loremipsum-bundle             v1.0.3             Generate paragraphs, sentences and words for your development.
braincrafted/bootstrap-bundle            v2.2.0             BraincraftedBootstrapBundle integrates Bootstrap into Symfony2 by providing te...
cocur/slugify                            v3.2               Converts a string into a slug.
composer/ca-bundle                       1.1.4              Lets you find a path to the system CA bundle, and includes a fallback to the M...
constantcontact/constantcontact          2.1.4              Constant Contact PHP SDK for v2
dario_swain/ds-recaptcha-bundle          dev-master fd97b51 Google ReCAPTCHA (ver. 2) Symfony Bundle.
dario_swain/re-captcha-library           1.0.1              Google ReCAPTCHA (ver. 2) backend provider.
dario_swain/re-captcha-validator         1.0.5              Google reCaptcha FormType and Validator for Symfony applications.
doctrine/annotations                     v1.6.1             Docblock Annotations Parser
doctrine/cache                           v1.8.0             Caching library offering an object-oriented API for many cache backends
doctrine/collections                     v1.6.1             PHP Doctrine Collections library that adds additional functionality on top of ...
doctrine/common                          v2.10.0            PHP Doctrine Common project is a library that provides additional functionalit...
doctrine/data-fixtures                   v1.3.1             Data Fixtures for all Doctrine Object Managers
doctrine/dbal                            v2.9.2             Powerful PHP database abstraction layer (DBAL) with many features for database...
doctrine/doctrine-bundle                 1.11.2             Symfony DoctrineBundle
doctrine/doctrine-cache-bundle           1.3.5              Symfony Bundle for Doctrine Cache
doctrine/doctrine-fixtures-bundle        3.1.0              Symfony DoctrineFixturesBundle
doctrine/doctrine-migrations-bundle      v1.3.2             Symfony DoctrineMigrationsBundle
doctrine/event-manager                   v1.0.0             Doctrine Event Manager component
doctrine/inflector                       v1.3.0             Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator                    1.2.0              A small, lightweight utility to instantiate objects in PHP without invoking th...
doctrine/lexer                           v1.0.1             Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations                      v1.8.1             Database Schema migrations using Doctrine DBAL
doctrine/orm                             v2.6.3             Object-Relational-Mapper for PHP
doctrine/persistence                     1.1.1              The Doctrine Persistence project is a set of shared interfaces and functionali...
doctrine/reflection                      v1.0.0             Doctrine Reflection component
egeloen/ckeditor-bundle                  6.0.1              Provides a CKEditor integration for your Symfony2 Project.
egeloen/json-builder                     3.0.0              JSON builder with escaping control for PHP 5.6+
friendsofsymfony/jsrouting-bundle        1.6.3              A pretty nice way to expose your Symfony2 routing to client applications.
giggsey/libphonenumber-for-php           8.10.13            PHP Port of Google's libphonenumber
giggsey/locale                           1.7.1              Locale functions required by libphonenumber-for-php
guzzlehttp/guzzle                        5.3.3              Guzzle is a PHP HTTP client library and framework for building RESTful web ser...
guzzlehttp/psr7                          1.5.2              PSR-7 message implementation that also provides common utility methods
guzzlehttp/ringphp                       1.1.1              Provides a simple API and specification that abstracts away the details of HTT...
guzzlehttp/streams                       3.0.0              Provides a simple abstraction over streams of data
hoa/compiler                             3.17.08.08         The Hoa\Compiler library.
hoa/consistency                          1.17.05.02         The Hoa\Consistency library.
hoa/event                                1.17.01.13         The Hoa\Event library.
hoa/exception                            1.17.01.16         The Hoa\Exception library.
hoa/file                                 1.17.07.11         The Hoa\File library.
hoa/iterator                             2.17.01.10         The Hoa\Iterator library.
hoa/math                                 1.17.05.16         The Hoa\Math library.
hoa/protocol                             1.17.01.14         The Hoa\Protocol library.
hoa/regex                                1.17.01.13         The Hoa\Regex library.
hoa/stream                               1.17.02.21         The Hoa\Stream library.
hoa/ustring                              4.17.01.16         The Hoa\Ustring library.
hoa/visitor                              2.17.01.16         The Hoa\Visitor library.
hoa/zformat                              1.17.01.10         The Hoa\Zformat library.
ijanki/ftp-bundle                        v1.0.4             A Symfony2 Bundle to wrap the PHP ftp extension functionality in a more classy...
imagine/imagine                          v0.7.1             Image processing for PHP 5.3
incenteev/composer-parameter-handler     v2.1.3             Composer script handling your ignored parameter file
jdorn/sql-formatter                      v1.2.17            a PHP SQL highlighting library
jms/metadata                             2.0.0              Class/method/property metadata management in PHP
jms/serializer                           3.0.1              Library for (de-)serializing data of any complexity; supports XML, JSON, and Y...
jms/serializer-bundle                    3.3.0              Allows you to easily serialize, and deserialize data of any complexity
knplabs/gaufrette                        v0.8.1             PHP library that provides a filesystem abstraction layer
knplabs/knp-components                   v1.3.10            Knplabs component library
knplabs/knp-menu                         2.3.0              An object oriented menu library
knplabs/knp-menu-bundle                  v2.2.1             This bundle provides an integration of the KnpMenu library
knplabs/knp-paginator-bundle             v2.8.0             Paginator bundle for Symfony to automate pagination and simplify sorting and o...
kriswallsmith/assetic                    v1.4.0             Asset Management for PHP
kriswallsmith/buzz                       v0.16.1            Lightweight HTTP client
leafo/lessphp                            v0.5.0             lessphp is a compiler for LESS written in PHP.
leafo/scssphp                            v0.6.7             scssphp is a compiler for SCSS written in PHP.
liip/imagine-bundle                      1.9.1              This bundle provides an image manipulation abstraction toolkit for Symfony-bas...
liip/theme-bundle                        1.6.1              Provides theming support for #Symfony2 Bundles
misd/phone-number-bundle                 v1.3.2             Integrates libphonenumber into your Symfony2 application
mobiledetect/mobiledetectlib             2.8.33             Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses...
monolog/monolog                          1.24.0             Sends your logs to files, sockets, inboxes, databases and various web services
nelmio/cors-bundle                       1.5.5              Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony2 app...
nikic/php-parser                         v4.2.2             A PHP parser written in PHP
ocramius/package-versions                1.4.0              Composer plugin that provides efficient querying for installed package version...
ocramius/proxy-manager                   2.2.2              A library providing utilities to generate, instantiate and generally operate w...
oyejorge/less.php                        v1.7.0.14          PHP port of the Javascript version of LESS http://lesscss.org (Originally main...
paragonie/random_compat                  v9.99.99           PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
patchwork/jsqueeze                       v2.0.5             Efficient JavaScript minification in PHP
pdepend/pdepend                          2.5.2              Official version of pdepend to be handled with Composer
phpmd/phpmd                              2.6.0              PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of t...
psr/cache                                1.0.1              Common interface for caching libraries
psr/container                            1.0.0              Common Container Interface (PHP FIG PSR-11)
psr/http-message                         1.0.1              Common interface for HTTP messages
psr/log                                  1.1.0              Common interface for logging libraries
ralouphie/getallheaders                  2.0.5              A polyfill for getallheaders.
react/promise                            v2.7.1             A lightweight implementation of CommonJS Promises/A for PHP
sensio/distribution-bundle               v5.0.24            Base bundle for Symfony Distributions
sensio/framework-extra-bundle            v3.0.29            This bundle provides a way to configure your controllers with annotations
sensio/generator-bundle                  v3.1.7             This bundle generates code for you
sensiolabs/security-checker              v5.0.3             A security checker for your composer.lock
sonata-project/admin-bundle              3.13.0             The missing Symfony Admin Generator
sonata-project/block-bundle              3.15.0             Symfony SonataBlockBundle
sonata-project/cache                     2.0.1              Cache library
sonata-project/classification-bundle     3.6.1              Symfony SonataClassificationBundle
sonata-project/core-bundle               3.17.0             Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.5.0              Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.3.0              Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.1.7              Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle       2.5.0              Symfony SonataEasyExtendsBundle
sonata-project/exporter                  1.11.1             Lightweight Exporter library
sonata-project/intl-bundle               2.6.0              Symfony SonataIntlBundle
sonata-project/media-bundle              3.20.0             Symfony SonataMediaBundle
stnw/date-picker-bundle                  dev-master 82b168e DatePicker and DateTimePicker field type for Symfony2 and SonataAdminBundle.
suncat/mobile-detect-bundle              v1.1.1             Symfony2/3/4 bundle for detect mobile devices, managing mobile view types, red...
swiftmailer/swiftmailer                  v5.4.12            Swiftmailer, free feature-rich PHP mailer
symfony-cmf/media-bundle                 1.3.1              Symfony CMF Media Bundle
symfony/asset                            v3.4.28            Symfony Asset Component
symfony/assetic-bundle                   v2.8.2             Integrates Assetic into Symfony2
symfony/cache                            v4.3.0             Symfony Cache component with PSR-6, PSR-16, and tags
symfony/cache-contracts                  v1.1.1             Generic abstractions related to caching
symfony/class-loader                     v3.4.28            Symfony ClassLoader Component
symfony/config                           v4.3.0             Symfony Config Component
symfony/console                          v3.4.28            Symfony Console Component
symfony/contracts                        v1.1.0             A set of abstractions extracted out of the Symfony components
symfony/debug                            v4.3.0             Symfony Debug Component
symfony/dependency-injection             v3.4.28            Symfony DependencyInjection Component
symfony/doctrine-bridge                  v3.4.28            Symfony Doctrine Bridge
symfony/dotenv                           v4.3.0             Registers environment variables from a .env file
symfony/event-dispatcher                 v4.3.0             Symfony EventDispatcher Component
symfony/event-dispatcher-contracts       v1.1.1             Generic abstractions related to dispatching event
symfony/expression-language              v3.4.28            Symfony ExpressionLanguage Component
symfony/filesystem                       v3.4.28            Symfony Filesystem Component
symfony/finder                           v3.4.28            Symfony Finder Component
symfony/flex                             v1.2.5             Composer plugin for Symfony
symfony/form                             v3.4.28            Symfony Form Component
symfony/framework-bundle                 v3.4.28            Symfony FrameworkBundle
symfony/http-foundation                  v3.4.28            Symfony HttpFoundation Component
symfony/http-kernel                      v3.4.28            Symfony HttpKernel Component
symfony/inflector                        v4.3.0             Symfony Inflector Component
symfony/intl                             v4.3.0             A PHP replacement layer for the C intl extension that includes additional data...
symfony/maker-bundle                     v1.11.6            Symfony Maker helps you create empty commands, controllers, form classes, test...
symfony/monolog-bridge                   v4.2.9             Symfony Monolog Bridge
symfony/monolog-bundle                   v3.1.2             Symfony MonologBundle
symfony/options-resolver                 v3.4.28            Symfony OptionsResolver Component
symfony/phpunit-bridge                   v3.4.28            Symfony PHPUnit Bridge
symfony/polyfill-ctype                   v1.11.0            Symfony polyfill for ctype functions
symfony/polyfill-intl-icu                v1.11.0            Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring                v1.11.0            Symfony polyfill for the Mbstring extension
symfony/polyfill-php56                   v1.11.0            Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70                   v1.11.0            Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-php72                   v1.11.0            Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-util                    v1.11.0            Symfony utilities for portability of PHP codes
symfony/process                          v3.4.28            Symfony Process Component
symfony/profiler-pack                    v1.0.4             A pack for the Symfony web profiler
symfony/property-access                  v3.4.28            Symfony PropertyAccess Component
symfony/proxy-manager-bridge             v3.4.28            Symfony ProxyManager Bridge
symfony/routing                          v3.4.28            Symfony Routing Component
symfony/security                         v3.4.28            Symfony Security Component
symfony/security-acl                     v3.0.2             Symfony Security Component - ACL (Access Control List)
symfony/security-bundle                  v3.4.28            Symfony SecurityBundle
symfony/serializer                       v3.4.28            Symfony Serializer Component
symfony/service-contracts                v1.1.2             Generic abstractions related to writing services
symfony/stopwatch                        v4.3.0             Symfony Stopwatch Component
symfony/swiftmailer-bundle               v2.6.7             Symfony SwiftmailerBundle
symfony/templating                       v3.4.28            Symfony Templating Component
symfony/translation                      v3.4.28            Symfony Translation Component
symfony/twig-bridge                      v3.4.28            Symfony Twig Bridge
symfony/twig-bundle                      v3.4.28            Symfony TwigBundle
symfony/validator                        v3.4.28            Symfony Validator Component
symfony/var-dumper                       v4.3.0             Symfony mechanism for exploring and dumping PHP variables
symfony/var-exporter                     v4.3.0             A blend of var_export() + serialize() to turn any serializable data structure ...
symfony/web-profiler-bundle              v4.0.15            Symfony WebProfilerBundle
symfony/yaml                             v3.4.28            Symfony Yaml Component
tecnickcom/tcpdf                         6.2.26             TCPDF is a PHP class for generating PDF documents and barcodes.
twig/extensions                          v1.5.4             Common additional features for Twig that do not directly belong in core
twig/twig                                v1.42.0            Twig, the flexible, fast, and secure template language for PHP
twitter/bootstrap                        v3.4.1             The most popular front-end framework for developing responsive, mobile first p...
whiteoctober/tcpdf-bundle                1.1.2              A bundle to easily integrate TCPDF into Symfony2
willdurand/jsonp-callback-validator      v1.1.0             JSONP callback validator.
zendframework/zend-code                  3.3.1              provides facilities to generate arbitrary code using an object oriented interface
zendframework/zend-eventmanager          3.2.1              Trigger and listen to events within a PHP application
zendframework/zenddiagnostics            v1.5.0             A set of components for performing diagnostic tests in PHP applications
bocharsky-bw commented 5 years ago

I have downgraded to latest "jms/serializer-bundle": 3.x to 1.2.0, But now have below issue

Hm, I see JMS serializer wasn't downgraded to 1.2.0 as you said. Did you revert that downgrade?

Pasuvan commented 5 years ago

@xabbuh thanks for alignment. @bocharsky-bw yes i was revert.Now i downgrade JMS serialize 1.2.0.

Pasuvan commented 5 years ago

@bocharsky-bw Any updates above issue?. Please provide solution ASAP. Thanks

xabbuh commented 5 years ago

@Pasuvan I suggest to revert your code to the last working change and then try to update packages selectively and not all at once. If you need further help with that, you can use one of the support channels. In any case, this doesn't seem to be related to the recipes. So I am going to close here. Thank you for understanding.