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

Error using #2

Open
chanzler opened this issue Jun 7, 2015 · 11 comments
Open

Error using #2

chanzler opened this issue Jun 7, 2015 · 11 comments

Comments

@chanzler
Copy link

chanzler commented Jun 7, 2015

Hi,
when i use your bundle like this:
{% include 'ValitonShariffBundle:Shariff:shariff.html.twig' with {'locale': 'de', 'url': 'www.domain.de'} %}

I get the following error:

request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Catchable Fatal Error: Argument 1 passed to Valiton\Bundle\ShariffBundle\Controller\ShariffController::__construct() must be an instance of Valiton\Bundle\ShariffBundle\Service\ShariffServiceInterface, none given, called in D:\Development\xampp\htdocs\metzgercheck\app\cache\dev\classes.php on line 2138 and defined" at D:\Development\xampp\htdocs\metzgercheck\vendor\valiton\shariff-bundle\Valiton\Bundle\ShariffBundle\Controller\ShariffController.php line 25 {"exception":"[object](Symfony\Component\Debug\Exception\ContextErrorException%28code: 0%29: Catchable Fatal Error: Argument 1 passed to Valiton\Bundle\ShariffBundle\Controller\ShariffController::__construct%28%29 must be an instance of Valiton\Bundle\ShariffBundle\Service\ShariffServiceInterface, none given, called in D:\Development\xampp\htdocs\metzgercheck\app\cache\dev\classes.php on line 2138 and defined at D:\Development\xampp\htdocs\metzgercheck\vendor\valiton\shariff-bundle\Valiton\Bundle\ShariffBundle\Controller\ShariffController.php:25)"} []

@uwej711
Copy link
Member

uwej711 commented Jun 8, 2015

This sounds rather strange, what version of Symfony are you using? The arguments to the controller should be passed in by the service configuration or do you instantiate it yourself? Do you use the bundle's routing.xml, e.g. having something like this in your application's routing.yml:

valiton_shariff:
    resource: "@ValitonShariffBundle/Resources/config/routing.xml"
    prefix:   /shariff

@chanzler
Copy link
Author

chanzler commented Jun 8, 2015

I use Symfony 2.6.9
I did not overwrite any routing or services.I just installed your bundle. My configuration looks exactly like the one in the installation instructions, I just changed the "your-domain" string. I do not have a facebook app_id/secret.

@uwej711
Copy link
Member

uwej711 commented Jun 9, 2015

Please add the following to your roouting.yml in app/config:

valiton_shariff:
    resource: "@ValitonShariffBundle/Resources/config/routing.xml"
    prefix:   /shariff

@uwej711
Copy link
Member

uwej711 commented Jun 9, 2015

This is missing in the README

@chanzler
Copy link
Author

chanzler commented Jun 9, 2015

Thank you, this takes me one step further, but now I get another error:

Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Catchable Fatal Error: Argument 3 passed to GuzzleHttp\Client::request() must be of the type array, string given, called in /.../vendor/guzzlehttp/guzzle/src/Client.php on line 88 and defined" at /.../vendor/guzzlehttp/guzzle/src/Client.php line 127 {"exception":"[object](Symfony\Component\Debug\Exception\ContextErrorException%28code: 0%29: Catchable Fatal Error: Argument 3 passed to GuzzleHttp\Client::request%28%29 must be of the type array, string given, called in /.../vendor/guzzlehttp/guzzle/src/Client.php on line 88 and defined at /.../vendor/guzzlehttp/guzzle/src/Client.php:127)"} []

@uwej711
Copy link
Member

uwej711 commented Jun 10, 2015

Can you create a complete stacktrace by using the dev controller, so that we see, where this method is called? This could be an incompatible guzzle version.

@uwej711
Copy link
Member

uwej711 commented Jun 10, 2015

btw guzzle is required by the shariff-backend-php not by this bundle

@uwej711
Copy link
Member

uwej711 commented Jun 24, 2015

Could you solve the issue?

@MHaendel
Copy link

Hey uwe,

I encountered the same Problem as chanzler (Catchable Fatal Error: Argument 3 passed to GuzzleHttp\Client::request() must be of the type array, string given)

StackTrace:

[1] Symfony\Component\Debug\Exception\ContextErrorException: Catchable Fatal Error: Argument 3 passed to GuzzleHttp\Client::request() must be of the type array, string given, called in C:\Program Files (x86)\Ampps\www\cashy\vendor\guzzlehttp\guzzle\src\Client.php on line 87 and defined
    at n/a
        in C:\Program Files (x86)\Ampps\www\cashy\vendor\guzzlehttp\guzzle\src\Client.php line 126

    at Symfony\Component\Debug\ErrorHandler->handleError('4096', 'Argument 3 passed to GuzzleHttp\Client::request() must be of the type array, string given, called in C:\Program Files (x86)\Ampps\www\stuff\vendor\guzzlehttp\guzzle\src\Client.php on line 87 and defined', 'C:\Program Files (x86)\Ampps\www\stuff\vendor\guzzlehttp\guzzle\src\Client.php', '126', array('method' => 'createRequest', 'uri' => 'GET'))
        in C:\Program Files (x86)\Ampps\www\stuff\vendor\guzzlehttp\guzzle\src\Client.php line 126

    at GuzzleHttp\Client->request('createRequest', 'GET', 'https://graph.facebook.com/fql?q=SELECT total_count FROM link_stat WHERE url="https://stuff.com/slug1"')
        in C:\Program Files (x86)\Ampps\www\stuff\vendor\guzzlehttp\guzzle\src\Client.php line 87

http://stuff.dev/app_dev.php/shariff/get?url=https%3A%2F%stuff.io%2Fapp_dev.php%2Fslug1

It seems its using the wrong Guzzle Client, the one I installed, maybe there is an option to set the Guzzle Client to the one from Heise via config?

@uwej711
Copy link
Member

uwej711 commented Oct 16, 2015

Can you check the guzzle version in your composer.lock file? shariff-backend-php only works with version 5.2 and greater but not version 6. The latest shariff-backend-php has this constraint in the composer.json but this bundle might not work with the latest shariff-backend-php

@uwej711
Copy link
Member

uwej711 commented Oct 16, 2015

so I just checked this bundle works with the latest shariff-backend-php

btw you can use

composer show -i

to find out which packages and versions are installed

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

3 participants