Just wondering about the code from views_plugin_argument_default_node

if (arg(0) == 'node' && is_numeric(arg(1))) {
  return arg(1);
}

Why we need the code?
Are there any pages with url = node/NID where menu_get_object() doesn't work?

CommentFileSizeAuthor
#1 quickfix-1514802-0.patch498 bytesChi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chi’s picture

Status: Active » Needs review
FileSize
498 bytes
tim.plunkett’s picture

Assigned: Unassigned » dawehner

This code goes all the way back to before git can tell me when it was added :(

I agree it looks suspicious, but it must have existed for some reason.

dawehner’s picture

One reason this might be needed for panel pages or other modules overriding "node/%node/view" with "node/%"

Here menu_get_object() doesn't work so arg() is somehow required. This would be somehow solved by the great context system in d8, but i guess this might be needed for some cases. What do you think?

Chi’s picture

Component: Code » Documentation
Status: Needs review » Needs work

Perhaps, we should document it in code.

DamienMcKenna’s picture

Assigned: dawehner » Unassigned
Issue summary: View changes