Hi,

I'm using CVM with Domain Access and Domain Context to make the site use a different display view mode instead of the 'Full content' one for different domains. I'm currently encountering a bug where if I have a node reference field on a node defined, the node will render with the view mode of the referenced node instead of the parent one.

How to repeat

  • Edit a node, add a value for a node reference field (that is configured to display using Rendered Node formatter) that has a different context to the main node
  • Save node

What happens

  • Node is rendered with wrong view mode (it is rendered with view mode that would have suited for the context of the referenced node specified in the node reference field)

What should happen

  • Contextual View Mode should ignore the context of the referenced node, and only work on the main page node instead

I think what happened is that the contextual_view_modes_node_view_alter() function fails to make a distinction between the main page node and any node that is being processed for the page. I'll attach a patch shortly.

Thanks,
Victoria

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

victoriachan’s picture

Yazzbe’s picture

Issue summary: View changes

Did that work for you? I'm in the exact same situation having domain access and domain context installed.

I've setup the global view modes per domain and content type, defined and tested the context, I'm having reference fields to other conten types & taxonomies ... and the wrong view mode is loaded.

Bb

zerolab’s picture

Status: Active » Reviewed & tested by the community

Running this patch on production on a large website without any issues.

  • sherakama committed dd82860 on 7.x-1.x authored by victoriachan
    Issue #2104691 by victoriachan: Wrong view mode is loaded when there are...
sherakama’s picture

Status: Reviewed & tested by the community » Fixed

Committed to dev.

Thank you for this.

Status: Fixed » Closed (fixed)

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