Gizra / og

https://www.drupal.org/project/og
92 stars 133 forks source link

Node context negotiation fails #34

Open kaaresl opened 9 years ago

kaaresl commented 9 years ago

Problem / Motivation

Issue #28 and commit 66d3b723 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 #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 commented 9 years ago

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

Yeah, lets revert