In the following code $entity_field_item is not defined nor used, whereas $item['value'] is used and can be an undefined index.

  // Special case formatter that returns the raw computed values without any display code processing.
  if ($display['type'] == "computed_field_computed_value") {
    foreach ($items as $delta => $item) {
      if (!isset($entity_field_item['value'])) {
        $entity_field_item['value'] = NULL;
      }
      $element[$delta] = array('#markup' => $item['value']);
    }
    return $element;
  }

Looks like $entity_field_item['value'] should read $item['value'].

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hughworm created an issue. See original summary.

hughworm’s picture

ram4nd’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: computed_field-undefined_index-2718603-1-7.x.patch, failed testing.

The last submitted patch, 2: computed_field-undefined_index-2718603-1-7.x.patch, failed testing.

hughworm’s picture

I've looked at the test results and have no idea why that patch failed testing. ram4nd can you?

ram4nd’s picture

I think the module fails tests. Don't think the module has testing implemented.