field_view_field() calls the field_attach_view alter hook with view_mode = '_custom'. Hence the notice on line 64 when trying to get the display.

Guessing that it's possible another call could be made with a different view_mode also not set in the display it's probably best to just do a isset() before grabbing the display.

Comments

ekes’s picture

Like...

ekes’s picture

Embarrassing sorry rushing around here a dsm() left in that!

olofbokedal’s picture

Status: Active » Needs review
StatusFileSize
new844 bytes

Although field_view_field() seems to call hook_field_attach_view_alter() with the _custom view mode, it seems that we're not getting the _custom view mode in $context. I don't know when this is altered, but I can't manage to reproduce this.

However, I'm getting the undefined index notice when I'm viewing the full node, without using a custom display configuration for Full content. AFAIK, that's the only view mode that will get called without having a custom configuration. This means that we should fallback to the default settings, when the current view mode doesn't have a configuration.

Please try this patch, and report the results :)

olofbokedal’s picture

Status: Needs review » Fixed

I assume that that the silence means that it's working.

The patch has been committed http://drupalcode.org/project/field_word_boundary.git/commit/7c6cff6.

Status: Fixed » Closed (fixed)

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

gianfrasoft’s picture

Status: Closed (fixed) » Active

After ugrade I have this other problem:

Notice: Undefined index: word_boundary in field_word_boundary_field_attach_view_alter() (line 69 of .../field_word_boundary/field_word_boundary.module).

olofbokedal’s picture

Status: Active » Fixed

Standardized the settings, to make sure that they'll never be undefined.

http://drupalcode.org/project/field_word_boundary.git/commit/50082c7.

Status: Fixed » Closed (fixed)

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