Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Node context negotiation fails #34

Open
kaaresl opened this issue Feb 25, 2015 · 1 comment
Open

Node context negotiation fails #34

kaaresl opened this issue Feb 25, 2015 · 1 comment
Labels

Comments

@kaaresl
Copy link

kaaresl commented Feb 25, 2015

Problem / Motivation

Issue #28 and commit 66d3b72 causes Node context negotiation to fail due to comparison between menu router path (pattern) and path instance:

        if (strpos(current_path(), $path) === 0) {

For nodes this result in comparison between e.g. node/1107 and node/%.

Proposed resolution

One of:

  1. Revert
  2. As explained in Do not load menu item just before determining context handler to prevent premature access denial due to empty og context. #28, the call to menu_get_item() may result in a new/nested call to og_context() due to menu router item object loading and translation. But one cannot compare a menu item path with a live path due to the above comparison failure, so you have to retrieve the menu router item from the current live path somehow. One solution is to implement a truncated version of menu_get_item() that halts processing the router item before item translation and object loading. It's only used to compare string. Leave it to the negotiation implementations to further check access control.
@amitaibu
Copy link
Member

Revert or find a better method to match menu paths vs actual paths.

Yeah, lets revert

kaaresl added a commit to kaaresl/og that referenced this issue Feb 26, 2015
…ernal function _og_context_get_menu_router_item()
kaaresl added a commit to kaaresl/og that referenced this issue Feb 27, 2015
- _og_context_get_menu_router_item() renamed to _og_context_menu_get_untranslated_item().
- Added static cache in _og_context_menu_get_untranslated_item().
kaaresl added a commit to kaaresl/og that referenced this issue Mar 6, 2015
…ernal function _og_context_get_menu_router_item()
kaaresl added a commit to kaaresl/og that referenced this issue Mar 6, 2015
- _og_context_get_menu_router_item() renamed to _og_context_menu_get_untranslated_item().
- Added static cache in _og_context_menu_get_untranslated_item().
kaaresl added a commit to kaaresl/og that referenced this issue Mar 6, 2015
kaaresl added a commit to kaaresl/og that referenced this issue Mar 6, 2015
kaaresl added a commit to kaaresl/og that referenced this issue Mar 6, 2015
kaaresl added a commit to kaaresl/og that referenced this issue Mar 6, 2015
MPParsley added a commit that referenced this issue Sep 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants