For me this module is not working. I tried page not found and redirect for a taxonomy vocabulary but its still showing the default taxonomy page.

screenshot of the settings

I also tried the module "Disable Term Node Listings" which is working and showing a 404 page. But i would love to have a redirect like its provided by this module.

Any suggestions? Im using the latest Drupal version 7.41 and the latest dev of this module.

THANKS ALOT :)

CommentFileSizeAuthor
termnotworking.png129.94 KBMickL
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MickL created an issue. See original summary.

olofbokedal’s picture

Perhaps you've got a view which overrides the taxonomy/term/% path? I'm pretty sure that Rabbit Hole won't work in those cases, since it's not the default page callback that is being used to display the term.

MickL’s picture

I dont see there is something like this activated. I also checked Panels and deactivated Display Suite. Are there more modules to check for?

I also figured out that it doesnt matter if there is a url specified(/customurl) for a term or no url specified(taxonomy/term/%id).

olofbokedal’s picture

Any module that changes the way how terms or entities overall are displayed. Rabbit Hole might not function at all if any module overrides the regular page callback.

Could you open the database and have a look in the menu_router table? Check the value of page_callback for path "taxonomy/term/%": SELECT page_callback FROM menu_router WHERE path = 'taxonomy/term/%'

MickL’s picture

Good idea! but Its only showing: taxonomy_term_page
I tried it out for nodes but its also not working.

olofbokedal’s picture

Strange. My guess is still that there's another module which is interfering with Rabbit Hole. It's hard to guess which one though. Perhaps you could provide further details of your site? Anything that might be interesting in order to reproduce this error.

olofbokedal’s picture

Status: Active » Closed (cannot reproduce)

Closing this since I'm not able to reproduce. Please re-open if the problem still persists and you can provide further information.

MickL’s picture

Status: Closed (cannot reproduce) » Active

Yes it still persists. I dont know how i could export my active-modules-list. The module is not working for taxonomy terms, but also not working for nodes. I had Panels and Display Suite installed but they are disabled.

Isnt it possible to force rabbit hole redirects? Like i the module "Disable Term Node Listings" is working fine.

Neograph734’s picture

@MickL did you try this as user 1?

I ran into a similar problem and found this issue. By default, Drupal grants the admin user all permissions regardless of the checkbox values on /admin/people/permissions. There is also the following permission:

Bypass Rabbit Hole action for nodes
Allows user to bypass the action that has been configured for nodes. 

Basically, if you try this as user 1 the redirect does not work (is bypassed). (That is a neat feature as it allows you to still edit the node as administrator.) Perhaps you should try it with a different user?

olofbokedal’s picture

Status: Active » Closed (cannot reproduce)

Closing this since no other users has reported any similar behavior.

Anybody’s picture

I can confirm #9 was also the reason in my case! Thanks! :)

Anybody’s picture

PS: Would it make sense to display a message for users if they are bypassing the behaviour? Shell we add a feature request for that? It might save us a lot of time...

Anybody’s picture

Title: Not working » Not working for taxonomy terms

PS: Would it make sense to display a message for users if they are bypassing the behaviour? Shell we add a feature request for that? It might save us a lot of time...

cubeinspire’s picture

I also had the same issue and is not straightforward if the redirection doesn't work for that or another reason. I think a drupal_set_message if User 1 is skipping the redirection would be a great benefit (for one line of code).

lukasss’s picture

I also lost a lot of time with it.
#9 works for me.
At least you need to add information about this in the README

Anybody’s picture

Category: Support request » Bug report
Status: Closed (cannot reproduce) » Active
marttir’s picture

As stated above, this issue will occur if any module sets taxonomy term page callbacks after rabbit_hole runs. In my case, the culprit was taxonomy_display.

Here's a workaround for getting rabbit_hole to work with taxonomy_display:


/**
 * Implements hook_module_implements_alter().
 *
 * Make sure our taxonomy hooks are run last.
 */
function MY_MODULE_module_implements_alter(&$implementations, $hook) {
  if ($hook != 'menu_alter') {
    return;
  }

  $taxonomy_display = $implementations['MY_MODULE'];
  unset($implementations['MY_MODULE']);
  $implementations['MY_MODULE'] = $taxonomy_display;
}

/**
 * Implements hook_menu_alter().
 */
function MY_MODULE_menu_alter(&$items) {
  // Use custom page callbacks so taxonomy pages and feeds use rabbit_hole.
  // This is done for compatibility with taxonomy_display module.
  if (isset($items['taxonomy/term/%taxonomy_term'])) {
    $items['taxonomy/term/%taxonomy_term'] = array(
      'page callback' => 'MY_MODULE_term_page',
      'file' => 'MY_MODULE.module',
      'module' => 'MY_MODULE',
    ) + $items['taxonomy/term/%taxonomy_term'];
  }
  if (isset($items['taxonomy/term/%taxonomy_term/feed'])) {
    $items['taxonomy/term/%taxonomy_term/feed'] = array(
      'page callback' => 'MY_MODULE_term_feed',
      'file' => 'MY_MODULE.module',
      'module' => 'MY_MODULE',
    ) + $items['taxonomy/term/%taxonomy_term/feed'];
  }
}

/**
 * Page callback for term pages.
 */
function MY_MODULE_term_page($term) {
  if (!user_access('bypass rh_taxonomy')) {
    rabbit_hole_execute('taxonomy_term', $term);
  }

  module_load_include('inc', 'taxonomy', 'taxonomy.pages');
  return taxonomy_display_taxonomy_term_page($term);
}

/**
 * Page callback for term feeds.
 */
function MY_MODULE_term_feed($term) {
  if (!user_access('bypass rh_taxonomy')) {
    rabbit_hole_execute('taxonomy_term', $term);
  }

  module_load_include('inc', 'taxonomy', 'taxonomy.pages');
  return taxonomy_term_feed($term);
}

RAWDESK’s picture

Both "Disable Term Node Listing" and "redirect RH" didn't work for me, until I followed this :
https://www.drupal.org/node/1905320#comment-7041304

/admin/structure/views/view/taxonomy_term/edit -> disable entire view or each view display separately

webczarina’s picture