Notice: Undefined index: in field_delimiter_formatter_info() (line 121 of /public_html/example.com/sites/all/modules/field_delimiter/field_delimiter.module).
Notice: Undefined index: #entity_type in field_delimiter_field_attach_view_alter() (line 90 of /public_html/example.com/sites/all/modules/field_delimiter/field_delimiter.module).

error happened when i added a delimiter of

    to a field & displayed it through display suite
CommentFileSizeAuthor
#4 undefined_index-1195568.patch647 bytestheunraveler

Comments

TimelessDomain’s picture

<ul>

philip-iii’s picture

Well any news on this one? It affects display through views in particular. I am guessing wrong entity type gets passed on:

function field_delimiter_formatter_info($field_name, $entity_type, $bundle, $display) {

  $info =_field_info_collate_fields();
  // There is no bundle for this entity type so the bundle name is the
  // entity_type name.
  if (empty($bundle)) {
    $bundle = $entity_type;
  }

  $field_display = $info['instances'][$entity_type][$bundle][$field_name]['display'];
  $default = $field_display['default']['settings'];
  if (isset($field_display[$display]['settings'])) {
    return $field_display[$display]['settings'] + $default;
  }
  return $default;
}

where line 121 is:

  $field_display = $info['instances'][$entity_type][$bundle][$field_name]['display'];

and $entity_type is the problem here. Ideas how to go about it are welcome.

Views renders multiple values differently. There is no need for field delimiter with it. I need field delimiter only for individual pages. I was a few minutes short of trying to incorporate a view instead, since it is that annoying. I'd love to have a unified solution though.

Anonymous’s picture

Status: Active » Needs review

Looks like the wrong array was accidentally used. Changing line 90 in field_delimiter.module from this

$info = field_delimiter_formatter_info($field_name, $output['#entity_type'], $output['#bundle'], $context['view_mode']);

to this

$info = field_delimiter_formatter_info($field_name, $element['#entity_type'], $element['#bundle'], $context['view_mode']);

seems to fix the issue.

Cheers

theunraveler’s picture

StatusFileSize
new647 bytes

Here is this fix as a patch.

theunraveler’s picture

Status: Needs review » Needs work
theunraveler’s picture

Status: Needs work » Needs review
radimklaska’s picture

The patch in #4 seems to fix the problem for me. Thanks!

Robin Millette’s picture

Status: Needs review » Reviewed & tested by the community
cweagans’s picture

Works well for me too.

andrewmacpherson’s picture

Status: Reviewed & tested by the community » Fixed

fixed in dev, will roll new release soon.

Gave commit credits for dro0x and theunraveler, thanks!

Status: Fixed » Closed (fixed)

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