I want to use both Panels and Taxonomy Node Order to manage my taxonomy pages, but it looks like Node Order is locking Panels out of that page.

When I enable the Node Order module, it disables the Panels taxonomy override. It doesn't produce an error message, it just disables that particular page and shows the default. And if I enable Node Order first, then try to enable that Panel override, Panels isn't allowed to override it -- the error message says it has already been overriden by Node Order.

I found patches for other combinations of taxonomy-related modules, but not for this set. If you can replicate and know how to fix, I'd appreciate it!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

caskraker’s picture

+1: same here.

stealthtech1’s picture

Same here.

Proteo’s picture

Issue summary: View changes

I'm in the same boat. If somebody found a solution please share it, it will be greatly appreciated.

Proteo’s picture

Nevermind… a quick trip to nodeorder.module revealed the culprit. In the nodeorder_menu() function, just delete (or comment) the last array entry ('taxonomy/term/%taxonomy_term') and flush all caches. This will give you back the ability to use taxonomy term templates in Panels.

This is of course just a hack, but for this specific purpose it should do the job. As far as I can tell, this shouldn't affect any module features (I did some informal testing, everything seems to be working fine). If I can spot any issues with this "solution" I will update this post.

dieuwe’s picture

Version: 7.x-1.1 » 7.x-1.x-dev

I had actually added a note about that menu entry being a failed attempt to override the page, because I don't believe it even sticks. Thanks for confirming.

I suspect this is just another D6 thing left over when this module was converted to D7.

dieuwe’s picture

Okay, so it seems that menu override is actually functional, but I'm just not sure why it's even there. I shall compare it to the taxonomy module to see what the original intention for this was.

If it is no longer needed then we'll fix this issue by removing that menu item from this module.

dieuwe’s picture

Okay, so this is the code difference between taxonomy_term_page() and nodeorder_taxonomy_term_page():

  // Set the term path as the canonical URL to prevent duplicate content.
  $uri = entity_uri('taxonomy_term', $term);
  drupal_add_html_head_link(array('rel' => 'canonical', 'href' => url($uri['path'], $uri['options'])), TRUE);
  // Set the non-aliased path as a default shortlink.
  drupal_add_html_head_link(array('rel' => 'shortlink', 'href' => url($uri['path'], array_merge($uri['options'], array('alias' => TRUE)))), TRUE);

(Above code was added in nodeorder and does not appear in taxonomy.)

Proteo’s picture

Hi dieuwe, thanks for stopping by. Maybe, that piece of code could be added somewhere else, I mean, without need to override the default callback? If that's not possible, another possibility could be having a new option in the vocabulary settings page that would allow the user to enable/disable this behavior.

From what I gather from a quick look at the code, this will override every single term page in the site, not just those from the selected vocabulary, am I right?

dieuwe’s picture

It seems the plan was to move this to a hook_menu_alter anyway. #1878144: Override menu url

I think we'll start by doing that and then adding an admin option to make this behaviour toggle-able (just in case), as you suggested. You would be right in assuming that this overrides every vocabulary.

I'll try to write up a patch this evening, give me an hour or so.

Proteo’s picture

Thanks for your help dieuwe, I'll try your patch tomorrow (it's almost 2:00 AM in this side of the world).

dieuwe’s picture

Status: Active » Needs review
FileSize
2.91 KB

The following patch does the following:

  • Adds a new option to the admin page to "Override the default taxonomy page with one from nodeorder"
  • Only overrides the taxonomy page if this box is checked.
  • In the process I decided to remove an obsolete variable that is no longer in use. Hence the hook_update_N.
  • Added a variable_del to the install file so that this module will install itself without leaving any variables in the future.

I'll commit if you're happy with it.

Proteo’s picture

Hi dieuwe, sorry for the delay (busy day). I tried the patch on two different installations (both 7.31) and it works great.

Since the new option still is "all or nothing", as a future improvement the module should override only terms of vocabularies where nodeorder is active (so the new setting would be better suited in the vocabulary's settings page), but I know that's easier said than done, and I'm not even sure if possible, so no worries.

A few notes for those applying the patch: make sure you use it against the version available in the Git repository (it won't work with the release or dev version). And after applying the patch, flushing caches and disabling the new option in the admin page, don't forget to reenable the taxonomy term template in your Panels page. I thought the patch didn't work until I noticed that Panels automatically disable it.

Many thanks for your support dieuwe!

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Works great, thank you:)

  • dieuwe committed 7949cf7 on 7.x-1.x
    Issue #1713048 by dieuwe, Proteo: Fixed Enabling taxonomy node order...
dieuwe’s picture

Status: Reviewed & tested by the community » Fixed

It might take a few hours for the dev version to be updated with this patch. I will also release a new stable version in the next week or two if no new issues are raised.

dieuwe’s picture

@Proteo, feel free to open a new issue (feature request), with your suggested improvements, linking back to this issue. I hope that one day I might get around to addressing this in more depth.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

patrickroma’s picture

the patch doesn't seem to work if a taxonomy term page is panelized by panelizer...

dieuwe’s picture

Can you elaborate?

The setting added here simply stops nodeorder from overriding the taxonomy term page so that any other module can do it instead.

If you check out the latest dev, disable the checkbox for overriding the taxonomy page, and clear the cache then nodeorder should no longer be the cause of any conflict.

don@robertson.net.nz’s picture

Hi - I have just installed the latest Node Order module (7.x-1.5), and it is overriding my Taxonomy Page in Panels. Do I still need to apply the patch, and if so, to which version. The version I am using was released July this year - the dev version November last year.

I am getting a warning on the panels page though.

don@robertson.net.nz’s picture

Ah - okay. Two step process - switch brain on, read post above.

Check checkbox and clear cache as mentioned. Seems to be working now. :-)