1

Hi guys (and gals) I'm trying to create a simple enhancement to one of my modules .inc files and am messing something up somewhere, and was hoping someone with sharp eyes can point it out. Even though it is extremely easy to just insert one line into the contrib file, do to our companies "best practices" I need to add this in another way.

I am trying add one extra variable into the $services array of the gigya_get_networks function, the function in gigya.inc is

function gigya_get_networks() {
  $services = array(
    'facebook' => 'Facebook',
    'myspace' => 'MySpace',
    'twitter' => 'Twitter',
    'google' => 'Google',
    'yahoo' => 'Yahoo',
    'aol' => 'AOL',
    'blogger' => 'blogger',
    'wordpress' => 'WordPress',
    'typepad' => 'typepad',
    'liveJournal' => 'liveJournal',
    'hyves' =>  'hyves' ,
    'veriSign' => 'veriSign',
    'linkedin' =>  'LinkedIn',
    'liveid' => 'Windows Live ID',
    'openid' => 'OpenID',
    'orkut' => 'Orkut',
  );
  return $services;
}

I created a new module in /custom/utilities/gigya_enhancements with the following

gigya_enhancements.info

name = Gigya Enhancements
description = Provides Gigya enhancements.
package = Gigya
php = 5.2

files[] = gigya_enhancements.module

dependencies[] = gigya

version = 7.x-3.1
core = 7.x

and a gigya_enhancements.module with the following

<?php
/**
 * Implements hook_get_networks().
 */
function gigyas_enhancements_get_networks() {

  // Add Vkontakte to existing services.
  $services = array(
    'vkontakte' => 'VKontakte', 
  );

    // shortcode: return $services['vkontakte'] = 'VKontakte';

  return $services;
}

But I'm not returning my additional array parameter, would someone mind explaining what I (evidently) have done wrong? Is it something to do with me trying to operate on an *.inc file maybe?

Thanks everyone.

1 Answer 1

2

Just adding an extra module with a similarly-named function won't guarantee that gigya will call that function. If Gigya's module has hooks (Google doesn't seem to be able to tell me at a glance), then that's the source for how to do what you're trying to do.

Also, you never need to put your .module file in files[]. That's only for files in the module that declare classes.

1
  • Thanks paul-m, much appreciated response. Gigya doesn't have hooks (unfortunately) so I created a git diff to patch the issue.
    – ehime
    Jan 20, 2012 at 20:30

Your Answer

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

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