You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem appears because in new version of ZF2 there is no ServiceLocator auto injected in LoaderPluginManagerFactory to new created LoaderPluginManager object . The workaround is to manually add ServiceLocator to object by changing the code of factory to:
$loaderPluginManager = new LoaderPluginManager(new Config($serviceLocator->get('Config')['htimg']['loaders']));
$loaderPluginManager->setServiceLocator($serviceLocator);
return $loaderPluginManager;
Module doesn't work after last ZF2 update (2.5.3) with ServiceLocatorAwareInterface are deprecated.
Fatal error appears:
Fatal error: Uncaught Error: Call to a member function get() on null in C:\SERVER\projects\mt\vendor\hrevert\ht-img-module\src\Factory\Imagine\Loader\FileSystemLoaderFactory.php:12 Stack trace: #0 [internal function]: HtImgModule\Factory\Imagine\Loader\FileSystemLoaderFactory->createService(Object(HtImgModule\Imagine\Loader\LoaderPluginManager), 'filesystem', 'FileSystem') #1 C:\SERVER\projects\mt\vendor\zendframework\zend-servicemanager\src\ServiceManager.php(936): call_user_func(Array, Object(HtImgModule\Imagine\Loader\LoaderPluginManager), 'filesystem', 'FileSystem') #2 C:\SERVER\projects\mt\vendor\zendframework\zend-servicemanager\src\AbstractPluginManager.php(330): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Array, 'filesystem', 'FileSystem') #3 C:\SERVER\projects\mt\vendor\zendframework\zend-servicemanager\src\AbstractPluginManager.php(287): Zend\ServiceManager\AbstractPluginManager->createServiceViaCallback(Array, 'filesystem', 'FileSystem') #4 C:\SERVER\projects\mt\vendor\zendframework\zend-servic in C:\SERVER\projects\mt\vendor\hrevert\ht-img-module\src\Factory\Imagine\Loader\FileSystemLoaderFactory.php on line 12
It works good with previous version of ZF2 (2.5.2)
The text was updated successfully, but these errors were encountered: