- πΊπΈUnited States smustgrave
Was previous tagged for tests in #6 which still needs to happen
Thanks.
When previewing nodes that use a Views Reference Field β with a view that includes a node contextual filter configured to use the default argument using the content id from the URL, the view does not render any results as expected and seen when rendering the node.
The node views argument default expects the node
parameter, as seen here.
\Drupal\node\Plugin\views\argument_default\Node::getArgument()
public function getArgument() {
if (($node = $this->routeMatch->getParameter('node')) && $node instanceof NodeInterface) {
return $node->id();
}
}
However, the entity.node.preview route provides the node_preview
parameter, which is upcasted to the node entity via the Drupal\node\ParamConverter\NodePreviewConverter()
See line 31 of node.routing.yml
entity.node.preview:
path: '/node/preview/{node_preview}/{view_mode_id}'
defaults:
_controller: '\Drupal\node\Controller\NodePreviewController::view'
_title_callback: '\Drupal\node\Controller\NodePreviewController::title'
requirements:
_node_preview_access: '{node_preview}'
options:
parameters:
node_preview:
type: 'node_preview'
Can we simply convert the parameter name in entity.node.preview from node_preview
to node
?
Patch, tests, ?
None
Unsure
None
Needs work
9.5
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Was previous tagged for tests in #6 which still needs to happen
Thanks.