removed i18n_taxonomy module from features dependencies

fixed some bugs
This commit is contained in:
Bachir Soussi Chiadmi 2015-11-24 23:50:19 +01:00
parent 9a18821b7e
commit 50dfd2d89b
6 changed files with 49 additions and 6 deletions

View File

@ -14,7 +14,6 @@ dependencies[] = field_extrawidgets
dependencies[] = field_group
dependencies[] = field_permissions
dependencies[] = file
dependencies[] = i18n_taxonomy
dependencies[] = image
dependencies[] = link
dependencies[] = list
@ -470,4 +469,5 @@ features[variable][] = print_sourceurl_forcenode
features[variable][] = print_urls
features[variable][] = print_urls_anchors
features[views_view][] = entity_reference_materiaux_breves
features_exclude[dependencies][i18n_taxonomy] = i18n_taxonomy
project path = sites/all/modules/features

View File

@ -4,7 +4,6 @@ core = 7.x
package = Materio
dependencies[] = ctools
dependencies[] = features
dependencies[] = i18n_taxonomy
dependencies[] = image
dependencies[] = materio_admin
dependencies[] = materio_user
@ -264,4 +263,5 @@ features[variable][] = uc_weight_format_oz
features[variable][] = uc_weight_unit
features_exclude[dependencies][uc_coupon] = uc_coupon
features_exclude[dependencies][uc_credit] = uc_credit
features_exclude[dependencies][i18n_taxonomy] = i18n_taxonomy
project path = sites/all/modules/features

View File

@ -4,6 +4,15 @@
* materio_user_profiles.features.inc
*/
/**
* Implements hook_ctools_plugin_api().
*/
function materio_user_profiles_ctools_plugin_api($module = NULL, $api = NULL) {
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}
}
/**
* Implements hook_default_profile2_type().
*/

View File

@ -8,15 +8,16 @@ dependencies[] = email
dependencies[] = entity
dependencies[] = features
dependencies[] = field_permissions
dependencies[] = i18n_taxonomy
dependencies[] = link
dependencies[] = list
dependencies[] = materio_content_types
dependencies[] = number
dependencies[] = options
dependencies[] = profile2
dependencies[] = strongarm
dependencies[] = taxonomy
dependencies[] = text
features[ctools][] = strongarm:strongarm:1
features[features_api][] = api:2
features[field_base][] = field_activity_sector
features[field_base][] = field_administrative_email
@ -132,4 +133,5 @@ features[user_permission][] = view own field_private_quality
features[user_permission][] = view own field_service
features[user_permission][] = view own field_siret
features[user_permission][] = view own field_user_website
features_exclude[dependencies][i18n_taxonomy] = i18n_taxonomy
project path = sites/all/modules/features

View File

@ -171,6 +171,9 @@ function materio_search_api_search_api_solr_dynamic_field_info() {
function materio_search_api_entity_property_info_alter(&$info){
// dsm($info, 'hook_entity_property_info_alter | info');
// watchdog('materio solr', 'materio_search_api_entity_property_info_alter', array());
// NODE PROPERTIES
$node_props = &$info['node']['properties'];
for ($i=1; $i <= 5 ; $i++) {
@ -214,6 +217,7 @@ function materio_search_api_entity_property_info_alter(&$info){
);
// TAXONOMIE TERMS PROPERTIES
$term_props = &$info['taxonomy_term']['properties'];
@ -223,6 +227,12 @@ function materio_search_api_entity_property_info_alter(&$info){
'type' => 'text',
'getter callback' => 'materio_search_api_term_property_dup_name',
);
// $term_props['materio_search_api_term_property_name_translated'] = array(
// 'label' => t("Term name translated"),
// 'description' => t(""),
// 'type' => 'text',
// 'getter callback' => 'materio_search_api_term_property_name_translated',
// );
}
/**
@ -421,10 +431,28 @@ function rip_tags($string) {
return $string;
}
/**
* Taxonomy terms properties
*/
function materio_search_api_term_property_dup_name($term){
$lang = $term->language;
return $term->name_field[$lang][0]['value'];
}
// function materio_search_api_term_property_name_translated($term){
// if($term->vid == 4){
// print_r(get_defined_vars());
//
// // print_r($term);
//
// $trans = module_exists('i18n_taxonomy')
// ? i18n_taxonomy_term_name($term, 'fr')
// : $term->name;
//
// print_r($trans);
// print "\n";
// }
// }
/**
* - - -- - - - - - - blocks - - - - - - - - - - -

View File

@ -39,6 +39,8 @@ function materio_taxonomy_menu_alter(&$items) {
* qui filtre les terms par language mm pour les vocabulaires en mode localized.
* utile pour la recherche avancée de materio_search_api materio_search_api_advanced_search_form()
*
*
* Inutile si i18n_taxonomy module is desactivate
*/
function materio_taxonomy_query_term_access_alter(QueryAlterableInterface $query) {
// dsm($query, 'materio taxo query');
@ -51,7 +53,7 @@ function materio_taxonomy_query_term_access_alter(QueryAlterableInterface $query
// dsm($condition, 'conditon '.$condition['field']);
if($condition['field'] == 't.vid'){
$vid = $condition['value'];
$i18n_voc_mode = i18n_taxonomy_vocabulary_mode($vid);
$i18n_voc_mode = module_exists('i18n_taxonomy') ? i18n_taxonomy_vocabulary_mode($vid) : 0;
// dsm($i18n_voc_mode, 'i18n_voc_mode');
}
}
@ -166,8 +168,10 @@ function materio_taxonomy_fr2en_batch($name, $t, &$context){
$oldname = $t->name;
$t->name = $name;
taxonomy_term_save($t);
$cont= array('term',$t->tid,'name');
i18n_string_textgroup('taxonomy')->update_translation($cont, 'fr', $oldname);
// $cont= array('term',$t->tid,'name');
// i18n_string_textgroup('taxonomy')->update_translation($cont, 'fr', $oldname);
// https://www.drupal.org/project/entity_translation_export_import
$context['message'][] = $oldname .' -> '. $name;
$_SESSION['http_request_count']++;