Commit ccbe585f authored by Dries's avatar Dries
Browse files

Issue #2221577 by andypost, alexpott, yched: Fix assumption that field...

Issue #2221577 by andypost, alexpott, yched: Fix assumption that field settings is not a nested array.
parent 961f1888
......@@ -8,6 +8,7 @@
namespace Drupal\Core\TypedData;
use Drupal\Component\Plugin\Exception\PluginException;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\String;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
......@@ -255,7 +256,7 @@ public function getPropertyInstance(TypedDataInterface $object, $property_name,
}
$key = $definition->getDataType();
if ($settings = $definition->getSettings()) {
$key .= ':' . implode(',', $settings);
$key .= ':' . Crypt::hashBase64(serialize($settings));
}
$key .= ':' . $object->getPropertyPath() . '.';
// If we are creating list items, we always use 0 in the key as all list
......
......@@ -20,7 +20,7 @@ abstract class EntityUnitTestBase extends DrupalUnitTestBase {
*
* @var array
*/
public static $modules = array('entity', 'user', 'system', 'field', 'text', 'filter', 'entity_test');
public static $modules = array('entity', 'user', 'system', 'field', 'text', 'filter', 'entity_test', 'entity_reference');
/**
* The entity manager service.
......
Supports Markdown
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