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

Incompatible default value in UnitOfWork #872

Open
rmbl opened this issue Aug 21, 2024 · 1 comment
Open

Incompatible default value in UnitOfWork #872

rmbl opened this issue Aug 21, 2024 · 1 comment

Comments

@rmbl
Copy link

rmbl commented Aug 21, 2024

I get the following error when updating phpcr-odm in an older project.

Cannot assign null to property Symfony\Component\Routing\Route::$condition of type string

condition was only added in newer versions and is not available in the old node entries. I was able to "fix" it by checking if the field is nullable before setting the default value in doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/UnitOfWork.php:532 but that feels a bit hacky.

Is there any way to easily migrate the old nodes to this newer version or is this a bug?

@dbu
Copy link
Member

dbu commented Sep 5, 2024

This is a change from routing bundle 3: https://github.com/symfony-cmf/routing-bundle/blob/3.x/CHANGELOG.md#300

Unfortunately, we did not document how to migrate existing data. I Think your best shot is the phpcr-shell update statements. You need to find a query that finds exactly all the routes and nothing else and then can set condition to ''. If you find a good query, it would be great to contribute it to the upgrade instructions of the routing bundle.

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

2 participants