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

@@ -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']++;