kinospro
Forum Replies Created
-
Forum: Plugins
In reply to: [Text Slider] WP Error on shortcodeHere is solution:
1. Go to base_dir/wp-content/plugins/text-slider/public/class-text-slider.php
2. Find block// Template tag. function wp_text_slider() { echo Text_Slider::get_instance()->shortcode(); }
3. Replace with
// Template tag. function wp_text_slider() { echo Text_Slider::get_instance()->shortcode(''); }
Done. Considering the fact this plugin didn’t update for last 2 years there will be no problems with plugin files overriding ??
Hey, guys! I’ve found solution! The problem was about the HybridAuth addon for this plugin. FB’ve moved from custom response format to JSON, but HybridAuth can’t process it. So your job is to help him to do that.
I’ll show here the one, that helped me:
“.. Well, for some reason, the response from /oauth/access_token became a valid JSON. The parse_str function was parsing a wrong format. For me changing this lines in the libraries/hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php resolved the issue: ”/** * Extend an access token, while removing the short-lived token that might * have been generated via client-side flow. Thanks to https://bit.ly/b0Pt0H * for the workaround. */ public function setExtendedAccessToken() { ... $response_params = array(); parse_str($access_token_response, $response_params); if (!isset($response_params['access_token'])) { return false; } ... } ... /** * Retrieves an access token for the given authorization code * (previously generated from www.facebook.com on behalf of * a specific user). The authorization code is sent to graph.facebook.com * and a legitimate access token is generated provided the access token * and the user for which it was generated all match, and the user is * either logged in to Facebook or has granted an offline access permission. * * @param string $code An authorization code. * @param string $redirect_uri Optional redirect URI. Default null * * @return mixed An access token exchanged for the authorization code, or * false if an access token could not be generated. */ public function getAccessTokenFromCode($code, $redirect_uri = null) { ... $response_params = array(); parse_str($access_token_response, $response_params); if (!isset($response_params['access_token'])) { return false; } ... }
To
/** * Extend an access token, while removing the short-lived token that might * have been generated via client-side flow. Thanks to https://bit.ly/b0Pt0H * for the workaround. */ public function setExtendedAccessToken() { ... $response_params = json_decode($access_token_response, true); // Not a valid JSON format if(!isset($response_params['access_token'])) { // Try to parse $response_params = array(); parse_str($access_token_response, $response_params); if (!isset($response_params['access_token'])) { return false; } } ... } ... /** * Retrieves an access token for the given authorization code * (previously generated from www.facebook.com on behalf of * a specific user). The authorization code is sent to graph.facebook.com * and a legitimate access token is generated provided the access token * and the user for which it was generated all match, and the user is * either logged in to Facebook or has granted an offline access permission. * * @param string $code An authorization code. * @param string $redirect_uri Optional redirect URI. Default null * * @return mixed An access token exchanged for the authorization code, or * false if an access token could not be generated. */ public function getAccessTokenFromCode($code, $redirect_uri = null) { ... $response_params = json_decode($access_token_response, true); // Not a valid JSON format if(!isset($response_params['access_token'])) { // Try to parse $response_params = array(); parse_str($access_token_response, $response_params); if (!isset($response_params['access_token'])) { return false; } } ... }
A bunch of other solutions you can find at Drupal HybridAuth social login module discussion. You can google it with the topic header, one of them may help ??
- This reply was modified 7 years, 7 months ago by kinospro.
Any updates for this issue? I receive the same responce now.