Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Error when viewing index #2

Closed
ghost opened this issue Nov 11, 2011 · 1 comment
Closed

Error when viewing index #2

ghost opened this issue Nov 11, 2011 · 1 comment

Comments

@ghost
Copy link

ghost commented Nov 11, 2011

Hi,

I just tried out the skeleton application, and I am getting this error? Catchable fatal error: Argument 1 passed to Zend\Config\Config::merge() must be an instance of Zend\Config\Config, array given, called in /home/xxx/public_html/_zf/library/Zend/Module/Manager.php on line 493 and defined in /home/xxx/public_html/_zf/library/Zend/Config/Config.php on line 387

@EvanDotPro
Copy link
Member

Based on the error you're receiving, I can tell you're not using a compatible version of ZF2 with the Skeleton (the proper commit of ZF2 does not even have 493 lines in Zend/Module/Manager.php).

If you are not using the provided git submodule, you should make sure to check out the proper commit in your local copy of ZF2 that matches what the ZendSkeletonApplication ZF2 submodule is pointed to.

At the time of writing this, the latest master of the ZendSkeletonApplication (3c3b45b) should be using commit 2238faa of the ZF2 repository.

The easiest way to make sure you're using the correct ZF2 commit is to utilize the provided Git submodule reference by simply cloning the skeleton with git clone --recursive as stated in the README.md file.

ptahdunbar pushed a commit to ptahdunbar/ZendSkeletonApplication that referenced this issue Jun 28, 2013
When using the ZendSkeletonApp along with ZFTool, the translator throws a fatal error due to an alias clash.

ZFTool registers the translator as a factory service, and with the skeleton app aliasing "translator", it throws:
```
Uncaught exception 'Zend\ServiceManager\Exception\InvalidServiceNameException' with message 'An alias by the name "translator" or "translator" already exists' in /Users/ptah/Sites/zf2SkeletonApp.dev/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:756
Stack trace:
#0 /Users/ptah/Sites/zf2SkeletonApp.dev/vendor/zendframework/zendframework/library/Zend/ServiceManager/Config.php(150): Zend\ServiceManager\ServiceManager->setAlias('translator', 'MvcTranslator')
zendframework#1 /Users/ptah/Sites/zf2SkeletonApp.dev/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ServiceListener.php(223): Zend\ServiceManager\Config->configureServiceManager(Object(Zend\ServiceManager\ServiceManager))
zendframework#2 [internal function]: Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))
zendframework#3 /Users/ptah/Sites/zf2SkeletonApp.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent))
zendframework#4 /Users/ptah/Sites/zf2 in /Users/ptah/Sites/zf2SkeletonApp.dev/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 756
```

The fix is to register the translator as a factory service within the skeleton app so zf2 can have fun overriding config definitions :)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant