Firstly, thanks to you and bucefal91 for all the work on this - I've been using heavily for a week or two.

One of the embeds I created was for 'entity.webform_submission.user' - I noticed I was getting the same results regardless of the user parameter (/user/1/submissions, /user/2/submissions etc.), because $args[3] is always the logged in user.

I've worked around that with the hook below, but the name in the page title also wrong. It may very well be my own fault - but if you've time to tell me where to look in the code (e.g. where are the $args for the view generated?) I can debug further.

Also, it may be unrelated, but I'm seeing a message in all embeds (including the originals) that the entity_id handler is broken…

function mymodule_views_pre_view(Drupal\views\ViewExecutable $view, $display_id, array &$args) {
	if ($view->id() === 'myview' && $display_id === 'embed_1' ) {
		$route_params = \Drupal::routeMatch()->getParameters();
		$args[3] = $route_params->get('user')->id();
	}
}

(Thanks)

CommentFileSizeAuthor
#3 2998630-3.patch610 bytesjrockowitz

Comments

wturrell created an issue. See original summary.

wturrell’s picture

Title: Views integration - UID arg is always 1? » Views integration - contextual filter arguments

(Better title).

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new610 bytes

Here is a quick stab at the problem.

wturrell’s picture

That works :)

  • jrockowitz committed f168f5f on 8.x-5.x
    Issue #2998630 by jrockowitz: Views integration - contextual filter...
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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