2

I can't seem to get the latest twitter module to work with my site.

I have a custom module that does some sanity checks on user-imported twitter accounts and my site keeps failing at this point. After some digging I noticed the twitter module functino twitter_account_load() is not recognized at all.

Devel test code to reproduce:

dpm(module_load_all()); // returns 1
dpm(module_exists('twitter')); // returns 1
dpm(twitter_account_load('@twitter')); // returns white screen of death

Apache error log:

PHP Fatal error: Call to undefined function twitter_account_load() in /var/www/mysite/httpdocs/sites/all/modules/contrib/devel/devel.module(1285) : eval()'d code on line 4, referer: http://my.site.com/devel/php

Drupal Version 7.26 Twitter Version 7.x-5.8

What I have tried so far:

  • Cache cleared
  • Twitter module upgrade to latest 5.8
  • Cache cleared
  • Twitter module reinstall
  • Cache cleared
  • ...

Nothing worked.

Any idea why?

1 Answer 1

5

Do module load include of twitter.inc in which above function was defined.. .module files are automatically included, but .inc are not. So you need to include them using above function...

module_load_include('inc', 'twitter', 'twitter');
dpm(module_load_all()); // returns 1
dpm(module_exists('twitter')); // returns 1
dpm(twitter_account_load('@twitter')); 
2
  • @vertoe .module files are automatically included, but .inc not. So, if you need a function that is in a .inc file usually you have to include manually.
    – sanzante
    Mar 5, 2014 at 10:22
  • Oh, i didn't know that. Your code works. Million thansk!
    – q9f
    Mar 5, 2014 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.