+++ b/core/modules/node/lib/Drupal/node/Plugin/views/argument_default/Node.phpundefined
@@ -0,0 +1,40 @@
+  function get_argument() {
+	foreach (range(1, 3) as $i) {
+  	$node = menu_get_object('node', $i);
+  	if (!empty($node)) {
+    	return $node->nid;
+  	}
+	}
+
+	if (arg(0) == 'node' && is_numeric(arg(1))) {
+  	return arg(1);

This is weird. It's also copy/pasted verbatim into a function in views module somewhere (see below).

I'm not really sure what the proper way to improving this is because there are acutal reasons for it.

One idea is to support other path structures like node/%node like foo/bar/%node or node/123 (but taken over by panels module). This will for sure be done completely different once we have a proper context system in place. Some similar code is in the user argument_default plugin.

Comments

xjm’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.x-dev
Component: Code » views.module
ekes’s picture

dawehner’s picture

Issue summary: View changes
Status: Active » Fixed

Yeah the menu_get_object() ones automatically takes care of them.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.