Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The serialiser doesn't work since version 3.16.0 #1437

Closed
CJDennis opened this issue Oct 24, 2022 · 6 comments
Closed

The serialiser doesn't work since version 3.16.0 #1437

CJDennis opened this issue Oct 24, 2022 · 6 comments

Comments

@CJDennis
Copy link

Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no

#1366 added the following lines to src/Metadata/ClassMetadata.php:

            $this->discriminatorGroups,
            $this->xmlDiscriminatorAttribute,
            $this->xmlDiscriminatorCData,
            $this->usingExpression,
            $this->xmlDiscriminatorNamespace,
            $this->xmlRootPrefix,
            $this->isList,
            $this->isMap,

I now get [PHPUnit\Framework\Error\Warning] Undefined array key 16 at vendor\jms\serializer\src\Metadata\ClassMetadata.php:322 when running tests since $this->discriminatorGroups (which is already included two lines above) does not exist in the array.

Steps required to reproduce the problem

  1. Use any version from 3.16.0 to 3.18.2
  2. Serialise some data

Expected Result

  • The data is serialised.

Actual Result

  • An error 500 in production mode.
  • [PHPUnit\Framework\Error\Warning] Undefined array key 16 in tests.
@goetas
Copy link
Collaborator

goetas commented Oct 24, 2022

please clear the cache

@eloirobe
Copy link

eloirobe commented Oct 27, 2022

I've cleared the cache, both using the command clear:cache and deleting it completely by removing the whole folder, and it still doesn't work. I did some checks and I believe it crashes in JMS\Serializer\Metadata\ClassMetadata.php, method unserializeFromArray. When we check the values inside the param $data, we see the current values:

image

@scyzoryck
Copy link
Collaborator

Hi! Are you using JMSSerializerBundle ? What is yours cache configuration?

@eloirobe
Copy link

Yes we're using JMSSerializerBundle
This is the Cache config with memcached also we clear memcached and not work:

framework:
    cache:
        default_memcached_provider: "%memcached.parameters%"
        pools:
            doctrine.result_cache_pool:
                adapter: cache.adapter.memcached
            doctrine.system_cache_pool:
                adapter: cache.adapter.memcached
            doctrine.second_level_cache_pool:
                adapter: cache.adapter.memcached
            doctrine.main_cache_region_pool:
                adapter: cache.adapter.memcached

@eloirobe
Copy link

Now it works We upgrade the JMSSerializerBundle from 3.9.x to version 4.0.x and it works. Is it possible that JMSSerializerBundle doesn't had well configure the require version of JMSSerializer in version 3.9.x?

@goetas
Copy link
Collaborator

goetas commented Oct 28, 2022

Please make sure to clean the cache (whatever cache you might be using, files, redis, apc...)

@goetas goetas closed this as completed Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants