-
Notifications
You must be signed in to change notification settings - Fork 29
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
Possible bug in Admingenerator\GeneratorBundle\DependencyInjection\AdmingeneratorGeneratorExtension::registerFormsServicesFromGenerator #288
Comments
@TheCelavi yes, this is obviously a bug, could you submit a PR to fix it? |
Of course, assign it to me. Agree with alias. Should I update this file https://github.com/symfony2admingenerator/GeneratorBundle/blob/master/UPGRADE.MD with info as well, is there any log in which change should be noted? |
There is no changelog, only what you mentioned - upgrade notes. |
…unique service name, no possibility for overwritting.
…unique service name, no possibility for overwritting.
Good one! Thanks @TheCelavi
Tru... but I'm not sure actually people use the service name itself: they are not necessary anymore if I'm not wrong... actually... not sure about that... |
@sescandell If someone used compiler pass to add additional dependencies to generated form type service (as we used to do so), new name without alias would be a BC break. I don't know what is your practice in development, but I have added TODO comment as reminder for alias to be removed in next major release when BC breaks are allowed. |
Fixed #288, auto generated form types now have unique service name.
Every auto-generated form is registered in:
Admingenerator\GeneratorBundle\DependencyInjection\AdmingeneratorGeneratorExtension::registerFormsServicesFromGenerator
Pattern is:
$container->setDefinition('admingen_generator_' . strtolower($model) . '_edit', $editDefinition);
Note that
_edit
can be_new
and_filter
as well.strtolower($model)
is used, and model is class name without namespace prefix.That means that, per example, classes:
\One\ModelX
\Two\ModelX
Would have generated form type service under the same name:
admingen_generator_modelx_edit
, and so on...That means that in case when we have models with same name under different namespaces, form type services gets overridden.
This is easy fix, can someone confirm this, just another pair of eyes, in case I am missing something?
The text was updated successfully, but these errors were encountered: