Question

I've just made a facebook module, it's working nicely, the only thing is that it doesn't install into the modules/custom folder. The module installs into the modules folder (the custom folder is located inside this modules folder).

How can I make sure the module installs into modules/custom?

This is my .install file.

/**
 * @file
 * Install, update and uninstall functions for the facebooklikebox module.
 */

/**
 * Implements hook_uninstall().
 */
function facebooklikebox_uninstall() {
  db_query("DELETE FROM {variable} WHERE name LIKE '%facebooklikebox%'");
  cache_clear_all('variables', 'cache');
}

function facebooklikebox_update_6101() {
  // Get the default settings
  drupal_load('module', 'facebooklikebox');
  $defaults = _facebooklikebox_get_settings(TRUE);

  // Define a settings array based on the variables already set (or their defaults)
  $settings = array(
    'facebooklikebox_pageurl' => variable_get('facebooklikebox_pageurl', 0),
    'facebooklikebox_height' => variable_get('facebooklikebox_height', 0),
    'facebooklikebox_width' => variable_get('facebooklikebox_width', 0),
    'facebooklikebox_bordercolor' => variable_get('facebooklikebox_bordercolor', 0),
    'facebooklikebox_showfaces' => variable_get('facebooklikebox_showfaces', 0),
    'facebooklikebox_showstream' => variable_get('facebooklikebox_showstream', 0),
    'facebooklikebox_showheader' => variable_get('facebooklikebox_showheader', 0),

  );

  // If a setting matches the default value, unset it (we wont need to store it)
  foreach ($settings as $key => $value) {
    // We used to use -1 for disabled, convert this to 0 for the new diabled
    if ($value == -1) {
      $settings[$key] = 0;
    }
    // Now compare the value to the defaults. Only store if an "override".
    if ($value == $defaults[$key]) {
      unset($settings[$key]);
    }
  }

  // Save the settings in a single array rather than individual keys
  if (!empty($settings)) {
    variable_set('facebooklikebox_settings', $settings);
  }

  // Remove all the old settings
  variable_del('facebooklikebox_pageurl');
  variable_del('facebooklikebox_height');
  variable_del('facebooklikebox_width');
  variable_del('facebooklikebox_bordercolor');
  variable_del('facebooklikebox_showfaces');
  variable_del('facebooklikebox_showstream');
  variable_del('facebooklikebox_showheader');
}

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top