-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
Getting errors because of API code bundle needs #686
Comments
Hi, for the 2.2 version of the this bundle, the dependency is requires. In the current master, the ApiBundle is removed (#650). |
Thanks. I will change to dev-master in the composer.json. |
Be aware of using the master version, because you are using a bleeding edge version. This should not be used for a production environment. |
Right. Any version that I can use that does not have this bundle issue? |
I see there was a new release. You could use version 2.2.4. |
Changed to 2.2.4, did composer update and got this:
|
Can you show your composer config? @AntonioCS |
I am experiencing the same problem, but I don't think it's SonataUserBundle's fault in my case. I am using the master branch, the api controllers do not get loaded by SonataUserBundle, which is correct, but for some reason JMSDiExtraBundle loads the controllers anyway (or at least they are not loaded if I disable JMSDiExtraBundle) and therefore it comes to the same exception as OP's initial one. Something is fucked up since i explicitly configured jms_di_extra:
locations:
all_bundles: false I guess this is the point when magic starts kicking your butt :-/ |
I have the same problem: using JMSDiExtraBundle without NelmioApiDocBundle. Maybe the problem relies in the cache warmer scanning all bundles folders and looking for controllers (note that It works if you disable the warmer: jms_di_extra:
cache_warmer:
enabled: false There is a blacklist option but it relies on the controller realpath. What about prepending the blacklist option if JMSDiExtraBundle is found but NelmioApiDocBundle not? Edit: I made a quick test with the following prepended configuration and it seems to work just fine (other sonata bundles have the same issue, like SonataClassificationBundle). I can work on a PR. public function prepend(ContainerBuilder $container)
{
$bundles = $container->getParameter('kernel.bundles');
if (isset($bundles['JMSDiExtraBundle']) &&
(!isset($bundles['NelmioApiDocBundle']) || !isset($bundles['FOSRestBundle']))) {
$blacklistedControllers = [];
foreach (glob(__DIR__.'/../Controller/Api/*.php', GLOB_NOSORT) as $filename) {
$blacklistedControllers[] = realpath($filename);
}
if (!empty($blacklistedControllers)) {
$container->prependExtensionConfig('jms_di_extra', [
'cache_warmer' => [
'controller_file_blacklist' => $blacklistedControllers,
],
]);
}
}
} |
Amazing work. Please do! |
@gremo Nice workaround. But I guess it would be preferrable if this would be fixed in JmsDiExtraBundle itself, so that |
@kaiwa I agree, but a PR (shouldn't hard to write) on JMSDiExtraBundle could take months to be accepted. In addition we have BC to older version of JMSDiExtraBundle. |
Did someone report the bug to
I think we can drop older versions if it's not a major version we're dropping. |
Yes I did, here you go: |
I just opened a new one schmittjoh/JMSDiExtraBundle#269 and I'm sending a PR. |
This seems to be solved, or atleast belongs to JMSDiExtraBundle. If I am wrong ping me and I will reopen |
Hey,
I have
"sonata-project/user-bundle": "^2.2"
in my composer.json.I do not plan to use any type of API component. When I do
composer update
I get this:Do I need to install & configure FOSRestBundle and NelmioApiDocBundle? Is this something that you are forcing users to do???
The text was updated successfully, but these errors were encountered: