Commit d560b48c authored by alexpott's avatar alexpott

Issue #2475237 by mkalkbrenner: Method FieldItemList::equals() uses type safe...

Issue #2475237 by mkalkbrenner: Method FieldItemList::equals() uses type safe comparison limiting usefulness.
parent 0489c18b
......@@ -402,7 +402,7 @@ public function equals(FieldItemListInterface $list_to_compare) {
array_walk($value1, $callback);
array_walk($value2, $callback);
return $value1 === $value2;
return $value1 == $value2;
}
}
......@@ -89,6 +89,14 @@ public function providerTestEquals() {
// Tests field item lists where both have the differently ordered values.
$datasets[] = [TRUE, $field_item_c, $field_item_d];
/** @var \Drupal\Core\Field\FieldItemBase $field_item_e */
$field_item_e = $this->getMockForAbstractClass('Drupal\Core\Field\FieldItemBase', [], '', FALSE);
$field_item_e->setValue(['2']);
// Tests field item lists where both have same values but different data
// types.
$datasets[] = [TRUE, $field_item_b, $field_item_e];
return $datasets;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment