I'm having a lot trouble installing Symfony's Services Container.

When enabling the module, Drupal's completely crashing and showing the following error:

Fatal error: Call to undefined method Symfony\Component\DependencyInjection\Definition::getFactory() in C:\inetpub\wwwroot\sites\all\modules\service_container\modules\providers\service_container_symfony\lib\Symfony\Component\DependencyInjection\ContainerBuilder.php on line 945

Am I missing something in the set up of this module?

Strainy

Comments

strainyy created an issue. See original summary.

strainyy’s picture

Issue summary: View changes
pol’s picture

Hello,

Which version of PHP are you using ?

strainyy’s picture

Hi Pol,

I'm using PHP Version 5.5.11

pol’s picture

Hi,

This version should be compatible with Service Container as it requires PHP > 5.3.10.

I won't be able to help you much as I'm not using Windows... Could you try to upgrade to the latest 5.5 PHP version ?

Thanks

strainyy’s picture

Hi Pol,

I'll give it a go and report back.

strainyy’s picture

I've just upgraded to version 5.5.28 and the issue is persisting.

pol’s picture

Oh, this is weird.

Are you using the latest beta ?

strainyy’s picture

I've tried both beta4 and beta5.

pol’s picture

Ah ok that's interesting.

You should not use beta4, we've committed a fix for Microsoft based servers in beta5.

Maybe your registry is broken, that's why it doesn't work. Could you try to rebuild your registry with drush rr ?

pol@x230 ~/git/drupal7 $ drush rr
The registry has been rebuilt via registry_rebuild (A).                                                            [success]  
All caches have been cleared with drush_registry_rebuild_cc_all.                                                   [success]  
The registry has been rebuilt via drush_registry_rebuild_cc_all (B).                                               [success]  
All caches have been cleared with drush_registry_rebuild_cc_all.                                                   [success]  
All registry rebuilds have been completed.                                                                         [success]  
pol@x230 ~/git/drupal7 $
strainyy’s picture

I've performed at registry rebuild using the module you linked me to and installed the beta5 release.
Unfortunately, the error is still appearing.

Thanks for your help so far btw!

pol’s picture

Are there any other errors in the log or in the drupal watchdog ?

NP you're welcome.

strainyy’s picture

Watchdog prints out a message saying that "service_container_symfony module enabled". When I refresh the modules page I can see that is the case. However, when I try and do something like enable OpenLayers, I get a similar kind of error (white screen, black text) with the following:

Fatal error: Call to undefined method Symfony\Component\DependencyInjection\Definition::getDecoratedService() in C:\inetpub\wwwroot\sites\all\modules\service_container\lib\Drupal\Core\DependencyInjection\Dumper\PhpArrayDumper.php on line 208

There really isn't any other useful information in the Drupal watchdog.

strainyy’s picture

Title: Can't enable Symfony Services Container » Fatal Error Enabling Symfony Services Container on Windows
pol’s picture

Hi,

Any update on this ? Did you get it working properly ?

Thanks.

strainyy’s picture

Hi Pol,

Unfortunately I was not able to install it without this error getting thrown. I had a few issues using OpenLayers that I'm sure must be connected to this.

I'm hoping to investigate this more when I get time.

Thanks for all your assistance so far.

meladawy’s picture

I confirm having this issue as well. Its not related to windows!

meladawy’s picture

I know we shouldn't touch Symfony components but temporary resolving this one by adding below condition in

sites\all\modules\service_container\modules\providers\service_container_symfony\lib\Symfony\Component\DependencyInjection\ContainerBuilder.php on line 945

        if (method_exists($definition, 'getFactory') && null !== $factory = $definition->getFactory()) {
markhalliwell’s picture

Version: 7.x-1.0-beta5 » 7.x-2.x-dev
markhalliwell’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Active » Closed (outdated)

The 7.x-2.x branch was premature, this project has been deprecated in favor of https://www.drupal.org/project/backport.