Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

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')); 
share|improve this answer
    
@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. –  tunic Mar 5 at 10:22
    
Oh, i didn't know that. Your code works. Million thansk! –  vertoe Mar 5 at 10:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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