Skip to content

Commit

Permalink
More robust approach
Browse files Browse the repository at this point in the history
  • Loading branch information
indigoxela committed Jul 11, 2024
1 parent 70e1465 commit 01fe0a6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions i18n_taxonomy/i18n_taxonomy.module
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,14 @@ function i18n_taxonomy_admin_paths() {
* Take over the taxonomy pages.
*/
function i18n_taxonomy_menu_alter(&$items) {
// If ctool's page manager is active for the path skip this modules override.
// Also views module takes over this page so this won't work if views enabled.
// Skip when taxonomy_display enabled, see http://drupal.org/node/1280194
if (!module_exists('taxonomy_display') && config_get('views.view.taxonomy_term', 'disabled')) {
// When views overrides this path, the item for this path is NULL at this
// point. But only since core version 1.28.0.
// @see https://github.com/backdrop-contrib/i18n/issues/134
$views_override = FALSE;
if (version_compare(BACKDROP_VERSION, '1.28.0', '>=') && !isset($items['taxonomy/term/%taxonomy_term'])) {
$views_override = TRUE;
}
if (!module_exists('taxonomy_display') && !$views_override) {
// Taxonomy term page. Localize terms.
$items['taxonomy/term/%taxonomy_term']['page callback'] = 'i18n_taxonomy_term_page';
$items['taxonomy/term/%taxonomy_term']['title callback'] = 'i18n_taxonomy_term_name';
Expand Down

0 comments on commit 01fe0a6

Please sign in to comment.