Details
-
Bug
-
Resolution: Fixed
-
High
-
5.4, 1.11.0
-
eZ Recommendation Bundle v1.2.1
-
Sprint 2
Description
The requests to YooChoose using Guzzle are not correctly logged when using Guzzle6. This line is responsible for logging the requests: https://github.com/ezsystems/EzSystemsRecommendationBundle/blob/master/Client/YooChooseNotifier.php#L412.
In my case (see steps to reproduce below) this line isn't executed because the argument type of the anonymous function isn't correct. Guzzle catches the following internal exception:
Argument 1 passed to EzSystems\RecommendationBundle\Client\YooChooseNotifier::EzSystems\RecommendationBundle\Client\{closure}() must be an instance of Guzzle\Http\Message\Response, instance of GuzzleHttp\Psr7\Response given, called in C:\Apache24\htdocs\ezplatform\vendor\guzzlehttp\promises\src\FulfilledPromise.php on line 39
This results in the message not being logged.
Customer also reports the related error in their Apache logs. I wasn't able to reproduce it directly (because of the above error), but the end effect is the same:
PHP Fatal error: Call to undefined method EzSystems\\RecommendationBundle\\Client\\YooChooseNotifier::log() in /xxx/vendor/ezsystems/recommendation-bundle/Client/YooChooseNotifier.php on line 412, referer: xxx
Steps to reproduce
- Set up the fresh installation of eZPlatform with eZ Recommendation using the install steps: https://github.com/ezsystems/EzSystemsRecommendationBundle#step-1-installation.
- Put the following configuration of eZ Recommendation in your config.yml file:
ez_recommendation: system: default: yoochoose: customer_id: "XXX" license_key: "XXX" server_uri: "http://your-site.dev" recommender: included_content_types: ["article"]
- Make sure you have logging enabled with the debug level (you can use dev environment for this purpose).
- Go to Platform UI and create and publish an article.
- Check your logs. There should be a message there that says "Got asynchronously 200 from YooChoose notification POST", but it isn't there.