Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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'].
Comment | File | Size | Author |
---|---|---|---|
#2 | computed_field-undefined_index-2718603-1-7.x.patch | 696 bytes | hughworm |
Comments
Comment #2
hughworm CreditAttribution: hughworm as a volunteer commentedComment #3
ram4nd CreditAttribution: ram4nd as a volunteer commentedComment #6
hughworm CreditAttribution: hughworm as a volunteer commentedI've looked at the test results and have no idea why that patch failed testing. ram4nd can you?
Comment #7
ram4nd CreditAttribution: ram4nd as a volunteer commentedI think the module fails tests. Don't think the module has testing implemented.