diff --git a/sites/all/modules/figli/edlp_corpus/src/Plugin/Block/BlockEntrees.php b/sites/all/modules/figli/edlp_corpus/src/Plugin/Block/BlockEntrees.php index c41142a15..57acdc47d 100644 --- a/sites/all/modules/figli/edlp_corpus/src/Plugin/Block/BlockEntrees.php +++ b/sites/all/modules/figli/edlp_corpus/src/Plugin/Block/BlockEntrees.php @@ -44,7 +44,7 @@ class BlockEntrees extends BlockBase { if($sid == 'generique_masque') continue; // translate the term $term = \Drupal::service('entity.repository')->getTranslationFromContext($term, $language); - $name = $term->getName(); + $name = $this->stripAccent($term->getName()); $ordered_trans_terms[$name] = $term; } @@ -68,7 +68,7 @@ class BlockEntrees extends BlockBase { 'data-drupal-link-system-path' => $url->getInternalPath() ) )); - $entree['term_link'] = Link::fromTextAndUrl($name, $url); + $entree['term_link'] = Link::fromTextAndUrl($term->getName(), $url); // index link $url = Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term'=>$tid]); @@ -113,4 +113,11 @@ class BlockEntrees extends BlockBase { ); } + private function stripAccent($str){ + return strtr( + utf8_decode($str), + utf8_decode('àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ'), + 'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY'); + } + }