Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#1 | quickfix-1514802-0.patch | 498 bytes | Chi |
Comments
Comment #1
Chi CreditAttribution: Chi commentedComment #2
tim.plunkettThis 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.
Comment #3
dawehnerOne 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?
Comment #4
Chi CreditAttribution: Chi commentedPerhaps, we should document it in code.
Comment #5
DamienMcKenna