The scenario is the next:
Let's have a two languague site in hungarian and english, using en and hu prefixes.
I have a content type with nodereference fields.
I create a view in path node/%/mypath, default full node view, provide default argument - node id from url
I create a node in english. When I go to hu/node/[nid] page, or en/node/[nid], everything is ok, but when I got to hu/node/[nid]/mypath, the nodereference fields doesn't exist, when the language prefix is NOT equivalent the node's language.
It happends because of the i18n uses menu_get_object() to define i18n selection mode, but if the menu item has node/%/mypath path, the menu_get_object() hasn't result. I've tried to use node/%node/mypath, but get 404 error.
I saw the views.module in _menu_alter somethings are changed when using % in path, but regexp is too hard for me. It should be nice to be able register some of default object in path (%node, %user, %term) as menu item.
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedIt is not possible to use %node because Views has its own loader so the % is always %views_arg in reality. %node would cause a fully loaded node to be sent to the argument, which is not what Views wants. So this is going to have to be fixed by i18n.
It is, however, nice to hear an explanation of why this happens.
Comment #2
Open Social CreditAttribution: Open Social commentedHey,
It will be really good if the function $node = menu_get_object('node') inside a hook_block would return the right node.
Use case:
I use the module service links.
I have an Organic group with a lot of tabs to views pages on it.
Like about and Subscribers and publishers and so on.
The service links will not be displayed because views registers not the node/%node but %views_arg.
Is that correct?
Comment #3
Open Social CreditAttribution: Open Social commentedI have changed the status to active,
Cause I want to know if this is possible to add,
I am checking the function if I can submit a patch myself.
Kind regards, Daniel
Comment #4
dawehnerI can't think of a way to do that, see http://drupal.org/node/1236840#comment-4820598
So you would have to use some logic with arg() or something similar, another reason why drupal needs a proper context system built in.
Comment #5
MustangGB CreditAttribution: MustangGB commented