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

Configuration template is outdated #231

Closed
e2video opened this issue Oct 21, 2021 · 7 comments · Fixed by #234
Closed

Configuration template is outdated #231

e2video opened this issue Oct 21, 2021 · 7 comments · Fixed by #234
Assignees
Labels
Bug Something isn't working
Milestone

Comments

@e2video
Copy link
Contributor

e2video commented Oct 21, 2021

Hello,
After composer update it's throwing error:
"detail": "Argument 1 passed to DoctrineMongoODMModule\Options\Configuration::setGenerateProxies() must be of the type int, bool given, called in /prj/vendor/laminas/laminas-stdlib/src/AbstractOptions.php on line 118"

If I set 'generate_proxies' => 1, then I get the same error for hydrators.
when I set 'generate_hydrators' => 1 then I get:

"detail": "Service with name "doctrine.configuration.odm_default" could not be created. Reason: Invalid proxy generation strategy given - only AUTOGENERATE_FILE_NOT_EXISTS and AUTOGENERATE_EVAL are supported."

and I have these commented and uncommenting doesn't help:

        //    'generate_persistent_collections' => Configuration::AUTOGENERATE_ALWAYS,
        //    'persistent_collection_dir' => 'data/DoctrineMongoODMModule/PersistentCollection',
        //    'persistent_collection_namespace' => 'DoctrineMongoODMModule\PersistentCollection',

Any idea what's missing?

Thanks

@driehle
Copy link
Member

driehle commented Oct 21, 2021

Could you please identify which packages you have updated?

If you ran composer update you may have updated several packages together. In such case you can do a rollback (hopefully you have your composer.lock in git), run composer show, then run composer update again and do another composer show. Either by comparing the output of the two composer show or by looking at the output of composer update, you should be able to tell a list of packages that you updated.

Since the last release of DoctrineMongoODMModule is from Nov 2020, I'd rather except an issue with an upstream dependency.

@e2video
Copy link
Contributor Author

e2video commented Oct 21, 2021

Hello Dennis and thank you for your quick response.
Very strange but I cloned my repo that was working and now I get the same error when run ./vendor/bin/doctrine-module
Will try to setup new project to see if something else is an issue and let you know

Thanks again.

@e2video
Copy link
Contributor Author

e2video commented Oct 21, 2021

After commenting generate_... blocks everything works fine:

// 'generate_proxies' => true,
// 'proxy_dir' => 'data/DoctrineMongoODMModule/Proxy',
// 'proxy_namespace' => 'DoctrineMongoODMModule\Proxy',
//
// 'generate_hydrators' => true,
// 'hydrator_dir' => 'data/DoctrineMongoODMModule/Hydrator',
// 'hydrator_namespace' => 'DoctrineMongoODMModule\Hydrator',

Looks like there is a change for using these but the template is still like this one.
Please advise.

Thanks

@driehle
Copy link
Member

driehle commented Oct 22, 2021

Indeed, if you look at module.config.php it says:

                'generate_proxies'   => Configuration::AUTOGENERATE_EVAL,
                'proxy_dir'          => 'data/DoctrineMongoODMModule/Proxy',
                'proxy_namespace'    => 'DoctrineMongoODMModule\Proxy',

                'generate_hydrators' => Configuration::AUTOGENERATE_ALWAYS,
                'hydrator_dir'       => 'data/DoctrineMongoODMModule/Hydrator',
                'hydrator_namespace' => 'DoctrineMongoODMModule\Hydrator',

                'generate_persistent_collections' => Configuration::AUTOGENERATE_ALWAYS,
                'persistent_collection_dir' => 'data/DoctrineMongoODMModule/PersistentCollection',
                'persistent_collection_namespace' => 'DoctrineMongoODMModule\PersistentCollection',
                'persistent_collection_factory' => null,
                'persistent_collection_generator' => null,

However, if you look module.doctrine-mongo-odm.local.php.dist, the file our installation guide instructs you to copy, it says:

//                'generate_proxies'   => true,
//                'proxy_dir'          => 'data/DoctrineMongoODMModule/Proxy',
//                'proxy_namespace'    => 'DoctrineMongoODMModule\Proxy',
//
//                'generate_hydrators' => true,
//                'hydrator_dir'       => 'data/DoctrineMongoODMModule/Hydrator',
//                'hydrator_namespace' => 'DoctrineMongoODMModule\Hydrator',
//
//                'generate_persistent_collections' => Configuration::AUTOGENERATE_ALWAYS,
//                'persistent_collection_dir' => 'data/DoctrineMongoODMModule/PersistentCollection',
//                'persistent_collection_namespace' => 'DoctrineMongoODMModule\PersistentCollection',
//                'persistent_collection_factory' => null,
//                'persistent_collection_generator' => null,

Would you like to create a pull request to fix this issue?

@driehle driehle added the Bug Something isn't working label Oct 22, 2021
@driehle driehle changed the title Error 500 Configuration template is outdated Oct 22, 2021
@e2video
Copy link
Contributor Author

e2video commented Oct 22, 2021

That works as expected.
Correct, I was using the instructions where I used module.doctrine-mongo-odm.local.php.dist and you're right it should be corrected.
Thanks!

@driehle
Copy link
Member

driehle commented Oct 22, 2021

I'll leave this one open as a reminder for fixing the template.

@driehle driehle added Help Wanted Extra attention is needed Good First Issue Good for newcomers labels Oct 22, 2021
@driehle driehle linked a pull request Oct 22, 2021 that will close this issue
@driehle driehle removed Good First Issue Good for newcomers Help Wanted Extra attention is needed labels Oct 22, 2021
@driehle driehle added this to the 3.0.3 milestone Oct 23, 2021
@driehle
Copy link
Member

driehle commented Oct 27, 2021

See release 3.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants