Hi all!

The title of issue says all about the problem. I find in my error_log these error messages:
PHP Fatal error: Class 'Hybrid_Exception' not found in .../sites/all/libraries/hybridauth/hybridauth/Hybrid/Endpoint.php

I'm using 2.4.0 version of hybridauth library

Otherwise the module works correctly, the google and facebook login too, there are no visible problems.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fox mulder created an issue. See original summary.

robit8deb’s picture

same here - mod works - error log filling up with this.

kevin_91’s picture

I have the same error. Can't log-in with LinkedIn.

Sylense’s picture

Same error. I've had some users notify me of this error while others can login with no problems. Each time they have stated they can login fine on desktop but receive this error on iPhone. Not sure what the difference would be but that is as much information as I have. I, myself, have not been able to replicate this on my end yet.

Not sure if LinkedIn updated their API (yet again). This problem didn't seem to arise until just recently.

JonathanHindi’s picture

I am facing the same thing were the same error get logged in the error log, I can login using facebook and google normally, however some users reported that they can't login.

afarrell’s picture

I was running into this error message too. The author of the hybridauth library expects you to use composer to install it, which would create an autoloader that would load the Hybrid_Exception when it's called. (This should result in your seeing a more meaningful exception in your logs.) I missed this when I installed HybridAuth at first. What you can do is:

1) Install composer according to the appropriate instructions at https://getcomposer.org/doc/00-intro.md
That's just going to put a composer.phar file wherever you run the installation.

2) Within the hybridauth directory, run "php ~/composer.phar install". (Replacing ~/ with an appropriate path if you installed composer.phar somewhere other than your home directory.)
That will add an "autoload.php" and some other files to the hybridauth/vendor directory.

Now, you need to make sure that autoload.php file is loaded when the HybridAuth module needs it. I'm using the Drupal 6 HybridAuth module, and I hope this is already handled in the D7 version. I wound up adding a require_once statement in hybridauth.pages.inc, in the hybridauth_endpoint function, but I'm not entirely sure that's the best way to go -- and the Drupal 7 version seems to be greatly reorganized.

duozersk’s picture

Priority: Normal » Major
klausi’s picture

Version: 7.x-2.13 » 7.x-2.x-dev
Status: Active » Needs review
FileSize
1.96 KB

My hacky solution: running "composer install" in the hybridauth library folder and then using the generated autoloader.

BenStallings’s picture

As long as we're contributing patches, here is an alternate approach that patches the library instead of the module. I realize that this is the issue queue for the module and not for the library, but this way takes only one line of code instead of many.

klausi’s picture

You forgot to load Hybrid_Logger and Hybrid_Error and possibly others.

That's the problem with manual includes: since Hybridauth is moving to composer autoloading there is potential for plenty more errors in the future.

giorgio79’s picture

Could integration with the https://www.drupal.org/project/composer_manager help?

giorgio79’s picture

Status: Needs review » Reviewed & tested by the community

The patch applies, but probably the module needs the compose manager integration to automate the vendor autoloading.

duozersk’s picture

  • duozersk committed 2ea5d1e on 7.x-2.x authored by klausi
    Issue #2554131 by klausi: PHP Fatal error:  Class 'Hybrid_Exception' not...
duozersk’s picture

Status: Reviewed & tested by the community » Fixed

Committed #8.

Thank you very much.
AndyB

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sagar.choudhary’s picture

I am facing weird problem, i am getting the same error in chrome browser but no error in firefox. I am using 7.x-2.13 version.

bob.hinrichs’s picture

Running 7.x-2.15, we are getting a handful of these errors as well, tied to line 205 of sites/all/libraries/hybridauth/hybridauth/Hybrid/Endpoint.php on line 205. We have quite a few people using the site using this module, so it is intermittent, and we can't replicate it to see what is happening. The initialization sequence is difficult to follow through the library to see what scenario might cause it.

We have a situation that is happening, with similar frequency, where users that create accounts via social login with hybridauth receive duplicate accounts in drupal. I don't know if it's related but logically it could be. The users are all Google+ users, who are connecting an account where their email address with google is not a gmail.com address, but are instead part of accounts set up as google educator accounts (e.g. 'xx@sfschools.k12.ca.us'). This makes it really hard for us to try to replicate, as we do not have google for education accounts to try. I'm wondering if there are some restrictions on some types of google accounts, or maybe differences in how they log into the google accounts, that cause this.
Some late-breaking news: I just got a comment from a colleague that the above duplicate user problem appears to happen when people click the button on the registration form multiple times (they are waiting for the social provider to respond).

Thought I'd add this here to see if anyone is still seeing some of these errors and whether your scenario for the occurrence of these errors has any similarity to ours.

ogggg’s picture

I have this issue on 7.x-2.15 version

dpliscoff’s picture

The message was appearing when logging out with a standard Drupal account, using version 2.15 on Drupal 7.53. Installing the hybridauth library using composer as recommended in #6 (without applying the patch in #8) fixed it.