I created a view at "node/$group/custom" and created a menu and tab to show under the group home page appropriately. I am passing group nid as first argument to show nodes only under the group. SO far this works fine.

Now I wanted to add another argument say "taxonomy term id" with default as "summary unsorted". This works also as expected showing only taxonomy terms with count of nodes under the term.

The problem is the URL that is constructed to point to actual detail list under the node is not correct. It always gives page not found error and looks like
"node/%24group/custom/[group nid]/[term id]"

notice %24 I think it is trying to use $ sign. Although removing it does not help.
I have also tried "summary sorted as view" as default display with no luck.

I also tried to summerize monthly but with no luck. Shows the month and nodes under it fine but actual link gives page not found.

SO there needs to be some way to construct correct URL

Comments

ajayg’s picture

Could this be related or regression of this?
http://drupal.org/node/130286

ajayg’s picture

The current URL constructed is
"node/%24group/custom/[group nid]/[term id]" (e.g node/%24group/custom/1357/116)

The correct URL constructed need to be
"node/[group nid]/custom/[term id] (e.g node/1357/custom/116)

I confirmed with the correct URL above, you get a list of nodes related to [term id] belonging only to the [group nid] as expected.
So something in the code is not replacing $group with [group nid] and is appending to the path instead.

I am NOT using token module so this seems to be from core OG

moshe weitzman’s picture

Status: Active » Closed (duplicate)

I'm not sure, but I think this is a dupe of http://drupal.org/node/183191. Also a possible dupe of http://drupal.org/node/201718

ajayg’s picture

Status: Closed (duplicate) » Postponed (maintainer needs more info)

I tried the patch referred in #183191: Tokens not substituted in breadcrumb above and that did not help. But the symptom mentioned in that issue correct and it won't accept anything other than "$arg"

I traced the issue to following code in views.module


function views_get_url($view, $args) {
  $url = $view->url;

  if (!empty($url)) {
    $where = 1;
    foreach ($args as $arg) {
      // This odd construct prevents us from strposing once there is no
      // longer an $arg to replace.
      if ($where && $where = strpos($url, '$arg')) {
        $url = substr_replace($url, $arg, $where, 4);
      }
      else {
        $url .= "/$arg";
      }
    }
  }

  return $url;
}

Correct me if I am wrong but the above code will only replace the string "$arg" in the path and NOT "$group" (or anyother string for that matter) as suggested in description right below the configuration of view for OG. So I tried "/node/$arg/custom" as path, provided group nid as first argument as before
and voila ! it worked fine. It also worked with a seperate monthly archive view I was trying. I am not using any special argument handling code.

My question is, this just a documentation issue (we need to use $arg and not $group) or I am likley see another issue if I am not using "$group" as a variable in my views associated with OG?

moshe weitzman’s picture

I really don't know if Views needs patching here or OG. Hopefully someone can investigate.

ajayg’s picture

It was a views patch to modify above function views_get_url. I have submitted patch for views here #183191: Tokens not substituted in breadcrumb and need review.

ajayg’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Confirmed (see my last comment above this is a views issue and not OG issue)