I discovered this while redirecting certain vocabulary/term paths to a custom view.
I think it is a known issue, but bothering nonetheless:

If one has Pathauto enabled with standard settings, Pathauto creates an alias in the form of [term:vocabulary]/[term:name] for every term that is created.

One can try and enter in the entity_path settings mycustompath/[term:tid] as long as one wants: it does not work, because the alias takes prevalence and redirects always to the alias.

Is it technically impossible to redirect also these paths, because Aliases are called later that entity_path?
It might trick a lot of people into believing the module does not work.

The only workaround I found was to not have created Aliases for Taxonomy terms at all, or have created an alias that matches the path I enter in entity_path.

Comments

derhasi’s picture

Status: Active » Postponed (maintainer needs more info)

Where do you enter mycustompath/[term:tid], in the browser, in the alias setting, or in the entity uri setting?

eigentor’s picture

I enter it in the entity uri setting.

sapiotech’s picture

I'm really confused trying to set up Entity Path as well. I have it working, but definitely not as I expected. My problems seem to be related to this issue, so maybe this will provide some more detail. We really need this module. I've been looking for a week and can't find this functionality anywhere.

My use case is using Category and Subcategory "node" content types which each insert and manage an item in the main menu (which is displayed by the Dynamic Persistent Menu module). I would like to have the menu links appear like: "menu/category/subcategory", which will bring up the appropriate Views page.

When I first configured the module, it seemed to be doing nothing. Then I noticed that when I delete and bulk update my path aliases in Pathauto, then Entity Path "fixes" the system path according to the tokens I set up. (I see this in Pathauto's list of aliases.) However, at the same time that I update, I lose the URL path settings in all of my content nodes, which puts me back to [node:nid] paths in the menu. Also, I was unable to alter the URL path settings for individual content nodes as long as Entity Path was installed. It's as though there is a conflict between the alias that the node is asking Pathauto to create and the one that it just created which was changed by Entity Path. Interestingly, when I tell Pathauto to delete all content node aliases, it leaves the aliases that have been touched by Entity Path. It takes a "delete all aliases" selection to clear them.

If I type an alias that has been fixed by Entity Path in the browser, it works! I see the Views page that I was expecting. With no aliases in Pathauto, it seems that Entity Path does nothing. The menu links look like: node/[node:nid] and they bring up the full node detail page instead of the Views page. Based on that, the next step was somehow logical.

I set a pattern in Pathauto to create aliases that look like: node/[node:nid]. Entity Path did its thing to change the System path to point to my Views pages and my content nodes lost their URL path settings. Since the menu links default back to node/[node:nid], it works!

It's ugly. And it feels wrong, but it works!

derhasi’s picture

@geoff_is_outback: That is because menu.module does it "wrong". @see http://api.drupal.org/api/drupal/modules%21menu%21menu.module/function/m... . It does not use the entity_uri(), but the hardcoded node/$node->nid.

@eigentor: could you manage the difference of aliases and the internal uri? Or do you need further assistance?

eigentor’s picture

@derhasi well I deleted the aliases and set Pathauto not to gererate aliases for the terms.
I just need some confirmation that I understood the way this module works correctly: If there is an alias, it overrides the entity uri, so one needs to make sure there are no aliases for the terms one wants to redirect?

derhasi’s picture

Entity path changes the internal path of an entity. For example the default internal path for a node is node/[nid], for a taxonomy term, that is taxonomy/term/[tid]. This internal path is directly coupled with a page callback function (@see hook_menu()).

An alias simply points to a specific internal path. This "translation" is done at first place. So if there is an alias set like "node/15" that points to "contact", you will not see the node view, but will see the contact form. (In that case node/15 is an alias and "contact" is the internal path.

In a default case, where you give an alias for specific node, the alias (e.g. "content/my-title") points to "node/15". In that case node/15 is the itnernal path and "content/my-title" is an alias.

If you have changed the entity path for a given node type (or a taxonomy), the internal paths for that entity bundle changes. But not every module does respect that change. So you have to change your aliases from the old internal path to the new one. Like "content/my-title" should not point to "node/15" anymore, but now should point to "myview/15" (we assume the entity path to be myview/[nid]

sapiotech’s picture

@derhasi: Thank you for your response and the good description of "how it works" in #6. Maybe that could be included in the docs, unless I just missed it.

Anyway, knowing the importance of using entity_uri(), I took another look. I was able to get the functionality I need using Menu Link (field) module and Entity Path together.

Thanks for a much needed module!

caw67’s picture

cant get it ot work. there is no redirect to my views path "produkte". i've tried it with url-alias, without, and nothing happend. can you give a step by step introduction how to setup a working taxonomy redirect on an existing view??? particularly in relation to the modul automatic path/url alias

derhasi’s picture

caw67, where is "no redirect"?

The module itself does no redirect. It simply provides the entity_uri() implementation. That is used (in most cases) to build the link to the specific entity (like a term).

derhasi’s picture

Issue summary: View changes

updated issue description