diff --git a/hierarchical_select.features.inc b/hierarchical_select.features.inc index ce8a38e..3c08659 100644 --- a/hierarchical_select.features.inc +++ b/hierarchical_select.features.inc @@ -90,7 +90,7 @@ function hierarchical_select_features_rebuild($module) { if (!empty($configs)) { // Apply the configuration. require_once(drupal_get_path('module', 'hierarchical_select') .'/includes/common.inc'); - + foreach ($configs as $config_id => $config) { hierarchical_select_common_config_set($config_id, $config); } diff --git a/modules/hs_taxonomy.install b/modules/hs_taxonomy.install index 94b6c05..b5f4d39 100644 --- a/modules/hs_taxonomy.install +++ b/modules/hs_taxonomy.install @@ -68,8 +68,8 @@ function hs_taxonomy_update_7301() { * vocabulary ID. */ function hs_taxonomy_update_7302() { - require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'hierarchical_select') . '/includes/common.inc'; - + require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'hierarchical_select') . '/includes/common.inc'; + $vocabularies = taxonomy_vocabulary_get_names(); foreach ($vocabularies as $machine_name => $vocabulary) { @@ -83,4 +83,4 @@ function hs_taxonomy_update_7302() { hierarchical_select_common_config_del($old_config_id); } } -} \ No newline at end of file +} diff --git a/modules/hs_taxonomy.module b/modules/hs_taxonomy.module index 1d920fe..e3d7ad4 100644 --- a/modules/hs_taxonomy.module +++ b/modules/hs_taxonomy.module @@ -194,40 +194,40 @@ function hs_taxonomy_form_taxonomy_form_term_alter(&$form, &$form_state) { } /** - *

Implementation of hook_taxonomy_vocabulary_save().

- * - *

This enables us to rename HS configs appropriately when machine names of - * taxonomy vocabularies change.

- * - * @param stdClass $vocabulary - * The vocabulary that is being updated. + * Implements hook_taxonomy_vocabulary_save(). + * + * This enables us to rename HS configs appropriately when machine names of + * taxonomy vocabularies change. + * + * @param stdClass $vocabulary + * The vocabulary that is being updated. */ function hs_taxonomy_taxonomy_vocabulary_update(stdClass $vocabulary) { require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'hierarchical_select') . '/includes/common.inc'; - + if (isset($vocabulary->original) && ($vocabulary->machine_name != $vocabulary->original->machine_name)) { $config = hs_taxonomy_get_config($vocabulary->original); - + if (!empty($config)) { $old_config_id = hs_taxonomy_get_config_id($vocabulary->original); - + hs_taxonomy_set_config($vocabulary, $config); hierarchical_select_common_config_del($old_config_id); } - } + } } /** - *

Implementation of hook_taxonomy_vocabulary_delete().

- * - *

This enables us to delete HS configs when vocabularies are deleted.

- * - * @param stdClass $vocabulary - * The vocabulary that is being deleted. + * Implements hook_taxonomy_vocabulary_delete(). + * + * This enables us to delete HS configs when vocabularies are deleted. + * + * @param stdClass $vocabulary + * The vocabulary that is being deleted. */ function hs_taxonomy_taxonomy_vocabulary_delete(stdClass $vocabulary) { require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'hierarchical_select') . '/includes/common.inc'; - + hierarchical_select_common_config_del(hs_taxonomy_get_config_id($vocabulary)); } @@ -1079,53 +1079,53 @@ function _hs_taxonomy_hierarchical_select_get_tree($vid, $parent = 0, $depth = - } /** - * Load the HS taxonomy config for the provided taxonomy vocabulary. - * - * @param stdClass $vocabulary - * The vocabulary for which a config will be loaded. - * - * @return array The config; or, an empty array if the config could not - * be loaded. + * Loads the HS taxonomy config for the provided taxonomy vocabulary. + * + * @param stdClass $vocabulary + * The vocabulary for which a config will be loaded. + * + * @return array + * The config, or an empty array if the config could not be loaded. */ function hs_taxonomy_get_config(stdClass $vocabulary) { return hierarchical_select_common_config_get(hs_taxonomy_get_config_id($vocabulary)); } /** - * Apply the HS taxonomy config for the provided taxonomy vocabulary to the + * Applies the HS taxonomy config for the provided taxonomy vocabulary to the * provided form element. - * - * @param array $element - * The form element. - * - * @param stdClass $vocabulary - * The vocabulary for which a config will be applied. + * + * @param array $element + * The form element. + * @param stdClass $vocabulary + * The vocabulary for which a config will be applied. */ function hs_taxonomy_apply_config(array &$element, stdClass $vocabulary) { hierarchical_select_common_config_apply($element, hs_taxonomy_get_config_id($vocabulary)); } /** - * Store the HS taxonomy config for the provided taxonomy vocabulary. + * Stores the HS taxonomy config for the provided taxonomy vocabulary. * - * @param stdClass $vocabulary - * The vocabulary for which a config will be loaded. + * @param stdClass $vocabulary + * The vocabulary for which a config will be loaded. * - * @return array $config - * The config to set. + * @return array $config + * The config to set. */ function hs_taxonomy_set_config(stdClass $vocabulary, array $config) { hierarchical_select_common_config_set(hs_taxonomy_get_config_id($vocabulary), $config); } /** - * Return the configuration ID that would be used for the specified taxonomy + * Returns the configuration ID that would be used for the specified taxonomy * vocabulary. - * - * @param stdClass $vocabulary - * The vocabulary for which a config ID will be returned. - * - * @return string The config id for the provided vocabulary. + * + * @param stdClass $vocabulary + * The vocabulary for which a config ID will be returned. + * + * @return string + * The config id for the provided vocabulary. */ function hs_taxonomy_get_config_id(stdClass $vocabulary) { return "taxonomy-{$vocabulary->machine_name}";