Skip to content
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

Cannot activate plugin - fresh install #172

Open
falljer opened this issue Jan 21, 2017 · 12 comments
Open

Cannot activate plugin - fresh install #172

falljer opened this issue Jan 21, 2017 · 12 comments

Comments

@falljer
Copy link

falljer commented Jan 21, 2017

Recently, I had ran "composer update" on a project I have been working on for the past several months to install a new plugin, and I started getting a fatal error on the Wordpress site if the Herbert plugin is enabled.

So, to narrow down the cause of the problem, I tried a fresh Wordpress install in my dev environment (downloaded today from wordpress.org) with a fresh Herbert download into the plugins directory, no customizations. Ran "composer install", and when I try to activate the plugin, I get the exact same message as my other project:

Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Unresolvable dependency resolving [Parameter #0 [ $app ]] in class Illuminate\Support\ServiceProvider in /Users/jeremyfall/Projects/wordpress/wp-content/plugins/herbert-dev/vendor/illuminate/container/Container.php:819 Stack trace: #0 /Users/jeremyfall/Projects/wordpress/wp-content/plugins/herbert-dev/vendor/illuminate/container/Container.php(757): Illuminate\Container\Container->unresolvablePrimitive(Object(ReflectionParameter)) #1 /Users/jeremyfall/Projects/wordpress/wp-content/plugins/herbert-dev/vendor/illuminate/container/Container.php(732): Illuminate\Container\Container->resolvePrimitive(Object(ReflectionParameter)) #2 /Users/jeremyfall/Projects/wordpress/wp-content/plugins/herbert-dev/vendor/illuminate/container/Container.php(708): Illuminate\Container\Container->resolveDependencies(Array) #3 /Users/jeremyfall/Projects/wordpress/wp-content/plugins/herbert-dev/vendor/illuminate/container/Container.php(565): Illuminate\Contai in /Users/jeremyfall/Projects/wordpress/wp-content/plugins/herbert-dev/vendor/illuminate/container/Container.php on line 819

If I can fix it, I will provide an update to the project, since I use Herbert a lot, and now it looks like I can't use it on any new projects, or update existing ones. But, I was hoping someone else had seen this, or could point me in the right direction here.

Thanks

@ken-bem
Copy link

ken-bem commented Jan 21, 2017

On your composer.json file put "stable" in your minimum-stability field

@falljer
Copy link
Author

falljer commented Jan 21, 2017

Thanks @ken-bem that worked! Question though: does this mean something is changing in Illuminate/Container that will break Herbert long-term? I'm wondering if I should continue developing Wordpress plugins with Herbert if it's no longer being maintained.

@ken-bem
Copy link

ken-bem commented Jan 21, 2017

Good that it did 💪🏽💪🏽. That is a good question, i feel there are 3 ways to tackle this problem:

  1. Make a repository with the stable version and only update when herbet is updated

  2. Make a repository and keep building in top of herbert, maybe even create a new herbert 👀( im thinkibg of doing this)

  3. Create your own framework from scratch

@talss89
Copy link

talss89 commented Jan 26, 2017

Hi, sorry to hijack this issue, but I had the same problem as @falljer. Changing minimum-stability didn't help (and I did delete composer.lock and ./vendor).

Adding "illuminate/container": "~5.1.0" to my project's composer.json require section did fix the problem for me.

I think that might be preferable to changing minimum-stability.

Do you think it's worth a PR?

Tom.

@ken-bem
Copy link

ken-bem commented Jan 26, 2017

Its definately worth a PR but you have to understand that it may take a while for someone to actually look at it, i suggest you create your own repository and make changes there, may help for new projects

@webstractions
Copy link

Thanks @talss89 for that fix.

@acermez
Copy link

acermez commented May 3, 2017

Hi everyone,
The origin of this issue is that the Illuminate\container::make() in version 5.4 is only accepting one argument instead of two. This could be fixed by changing all the calls to the container make() to makeWith() which is a replacement of the original make() at illuminate\container < 5.4 .
Make sure to require 5.4.x-dev (at the time of this post, the makeWith() is not part of the latest 5.4 release).
It is not a good solution off course as it is not permanent but if I can create a repo with the fix, I will post back. If anyone can point me how to merge the changes to this repo, that would be great.
Thanks!

@webstractions
Copy link

@acermez The differences between 5.3 to 5.4 are causing a lot of problems, not just in this package, but everywhere. And yes, the fork and create your own solution is the common way to deal with it.

@acermez
Copy link

acermez commented May 4, 2017

@webstractions, Thank you for pointing that out! I did not test it much after making it work, so I will try to give it more time and more real life scenarios as I really like how Herbert is handling backend panels and routing. I have been trying other packages such as Themosis Framework to build plugins, and still can't find a great one with easy backend routing and Laravel like flexibility.

@webstractions
Copy link

webstractions commented May 4, 2017

@acermez Themeosis seems to be on top of it. It is not a package to build plugins with, however. It is targeted at bridging Laravel with WordPress, and seems to do good job.

With that said, there probably is no right or wrong way of melding Laravel with WordPress. There are going to be some quirks.

I think projects like Herbert should not be advertised as a "plugin framework". It should be a Laravel Framework with WordPress as a dependancy. But that is just me.

@giangmd
Copy link

giangmd commented Jun 14, 2017

@talss89
Thanks. It's working for me now.

@tranphuoctien
Copy link

tranphuoctien commented Sep 8, 2017

Hi All, i just fixed it! we need edit composer.json file

{ "name": "getherbert/herbert-plugin", "description": "Herbert plugin", "license": "MIT", "require": { "getherbert/framework": "~0.9", "illuminate/contracts": "v5.1.1" }, "config": { "preferred-install": "dist" }, "minimum-stability": "stable", "autoload": { "psr-4": { "GHNShipping\\": "app/" } } }

It's working for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants