There was a similar issue.

I enable LInkedin
I get my api keys and install
If I choose disable I can navigate to my profile page
If I use any of the other options I get what I did above.

function linkedin_get_profile_fields is defined in
linkedin.inc:140:function linkedin_get_profile_fields($uid, $fields = array ())

But it is not being read in the submodule linkedin_profile.module

Comments

maddentim’s picture

I have this as well. I posted a couple comments on http://drupal.org/node/795936 but this issue seems to be narrower in focus. My twist to it is, I only get the failure when I go to system node paths (i.e. node/x). If I go to the alias path, no problem found.

deltab’s picture

The module does not find linkedin.inc, Just put this in the first line of linkedin_profile.module

/*
* Require .inc
*/
module_load_include('inc', 'linkedin', 'linkedin');

socialnicheguru’s picture

oh so simple sometimes... that worked!

maddentim’s picture

Ok, cool. I knew it was something simple.

Should this go alone or inside this function after the other module_load_include line?

function linkedin_profile_init() {
  global $theme_path;
  $li_css = $theme_path . '/linkedin_profile.css';
  if (file_exists($li_css)) {
    drupal_add_css($li_css);
  }
  else {
    drupal_add_css(drupal_get_path('module', 'linkedin_profile') . '/linkedin_profile.css');
  }
  module_load_include('pages.inc', 'linkedin_profile');
}
socialnicheguru’s picture

it didn't work for me inside the init function.

deltab’s picture

It has to be outside the init function, I got more intermittent errors with OAuth, and ended in copying almost everything from the linkedin.module init function into a new function linked_module_init.

Lousy coder here, so my patch might confuse most people, however, here is what I put

 module_load_include('inc', 'linkedin', 'linkedin');
 module_load_include('pages.inc', 'linkedin', 'linkedin');
  if (!@include_once(variable_get('linkedin_liboauth_path', ''))) {
    if (file_exists(drupal_get_path('module', 'oauth') . '/oauth.lib.php')) { // Cope with OAuth module 6.x
-2
      variable_set('linkedin_liboauth_path', drupal_get_path('module', 'oauth') . '/oauth.lib.php');
    }
    elseif (file_exists(drupal_get_path('module', 'oauth_common') . '/lib/OAuth.php')) { // Cope with OAuth
 module 6.x-3
      variable_set('linkedin_liboauth_path', drupal_get_path('module', 'oauth_common') . '/lib/OAuth.php');
    }
}
socialnicheguru’s picture

I tried #6 and all seems well for me.

bellesmanieres’s picture

Status: Active » Fixed

Should be fixed in dev, by ensuring the file is loaded before calling the function.

Status: Fixed » Closed (fixed)

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