As i mentioned in another issue we are using your wonderful module to provide the empty text for fields that users can click on to add items to empty fields (which would otherwise not be rendered).

We weren't sure of the purpose of the check at the top for viewmode and display equivalency but view_field_view (http://api.drupal.org/api/drupal/modules%21field%21field.module/function...) sends the context of the viewmode as '_custom' and this prevents your default text from every being output if it isnt renedered directly buy the node system from what i can tell.

The attached patch removes this check. If you have a second to explain why it was there id be happy to write around that use case and submit another patch. :).

Comments

Alan D.’s picture

Status: Active » Postponed (maintainer needs more info)

Maybe the missing patch would add context to this issue?

Alan D.’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

reopen if you ever find the missing patch ;)

epapaniko’s picture

Issue summary: View changes
Status: Closed (cannot reproduce) » Active

I would also like this check to be changed, at least.

I'm using quickedit at the same in order to edit fields inline, which calls field_view_field() and on a full node display the view_mode is _custom.

It also contradicts the code below:

  if ($context['view_mode'] == '_custom' && isset($context['display'])) {
    $view_mode = $context['display'];
  }

I don't know the usecase that this condition tried to solve, so maybe we could change it to something like the following?

if (empty($context['view_mode']) || empty($context['display']) || ($context['view_mode'] !== '_custom' && $context['view_mode'] != $context['display'])) {