diff --git a/core/modules/filter/src/Element/ProcessedText.php b/core/modules/filter/src/Element/ProcessedText.php index b81e0c5629..6e2b3ec43e 100644 --- a/core/modules/filter/src/Element/ProcessedText.php +++ b/core/modules/filter/src/Element/ProcessedText.php @@ -3,7 +3,6 @@ namespace Drupal\filter\Element; use Drupal\Core\Cache\Cache; -use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Render\BubbleableMetadata; use Drupal\Core\Render\Element\RenderElement; use Drupal\filter\Entity\FilterFormat; @@ -70,11 +69,7 @@ public static function preRenderText($element) { $langcode = $element['#langcode']; if (!isset($format_id)) { - $filter_settings = static::configFactory()->get('filter.settings'); - $format_id = $filter_settings->get('fallback_format'); - CacheableMetadata::createFromRenderArray($element) - ->addCacheableDependency($filter_settings) - ->applyTo($element); + $format_id = static::configFactory()->get('filter.settings')->get('fallback_format'); } /** @var \Drupal\filter\Entity\FilterFormat $format **/ $format = FilterFormat::load($format_id); diff --git a/core/modules/filter/src/FilterProcessResult.php b/core/modules/filter/src/FilterProcessResult.php index 2a8a71bd1f..3fa592b627 100644 --- a/core/modules/filter/src/FilterProcessResult.php +++ b/core/modules/filter/src/FilterProcessResult.php @@ -78,7 +78,7 @@ class FilterProcessResult extends BubbleableMetadata { * @param string $processed_text * The text as processed by a text filter. */ - public function __construct($processed_text = '') { + public function __construct($processed_text) { $this->processedText = $processed_text; } diff --git a/core/modules/hal/tests/src/Kernel/NormalizeTest.php b/core/modules/hal/tests/src/Kernel/NormalizeTest.php index e77d4b464a..d837b79a02 100644 --- a/core/modules/hal/tests/src/Kernel/NormalizeTest.php +++ b/core/modules/hal/tests/src/Kernel/NormalizeTest.php @@ -5,7 +5,6 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Url; use Drupal\entity_test\Entity\EntityTest; -use Drupal\filter\Entity\FilterFormat; /** * Tests HAL normalization edge cases for EntityResource. @@ -19,28 +18,6 @@ class NormalizeTest extends NormalizerTestBase { */ protected function setUp() { parent::setUp(); - // Create a text format because it is needed for TextItemBase normalization. - // @see \Drupal\text\Normalizer\TextItemBaseNormalizer::normalize(). - FilterFormat::create([ - 'format' => 'my_text_format', - 'name' => 'My Text Format', - 'filters' => [ - 'filter_html' => [ - 'module' => 'filter', - 'status' => TRUE, - 'weight' => 10, - 'settings' => [ - 'allowed_html' => '

', - ], - ], - 'filter_autop' => [ - 'module' => 'filter', - 'status' => TRUE, - 'weight' => 10, - 'settings' => [], - ], - ], - ])->save(); \Drupal::service('router.builder')->rebuild(); } @@ -60,7 +37,7 @@ public function testNormalize() { 'name' => $this->randomMachineName(), 'field_test_text' => [ 'value' => $this->randomMachineName(), - 'format' => 'my_text_format', + 'format' => 'full_html', ], 'field_test_entity_reference' => [ 'target_id' => $target_entity_de->id(), @@ -175,7 +152,6 @@ public function testNormalize() { [ 'value' => $values['field_test_text']['value'], 'format' => $values['field_test_text']['format'], - 'process_result' => "

{$values['field_test_text']['value']}

", ], ], ]; diff --git a/core/modules/rest/tests/src/Functional/EntityResource/Comment/CommentResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/Comment/CommentResourceTestBase.php index 5dd78ffed0..961441213a 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/Comment/CommentResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/Comment/CommentResourceTestBase.php @@ -5,7 +5,6 @@ use Drupal\comment\Entity\Comment; use Drupal\comment\Entity\CommentType; use Drupal\comment\Tests\CommentTestTrait; -use Drupal\Core\Cache\Cache; use Drupal\entity_test\Entity\EntityTest; use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase; use Drupal\user\Entity\User; @@ -201,7 +200,6 @@ protected function getExpectedNormalizedEntity() { [ 'value' => 'The name "llama" was adopted by European settlers from native Peruvians.', 'format' => 'plain_text', - 'process_result' => '

The name "llama" was adopted by European settlers from native Peruvians.

' . "\n", ], ], ]; @@ -254,20 +252,6 @@ protected function getNormalizedPatchEntity() { } /** - * {@inheritdoc} - */ - protected function getExpectedCacheTags() { - return Cache::mergeTags(parent::getExpectedCacheTags(), ['config:filter.format.plain_text']); - } - - /** - * {@inheritdoc} - */ - protected function getExpectedCacheContexts() { - return Cache::mergeContexts(['languages:language_interface', 'theme'], parent::getExpectedCacheContexts()); - } - - /** * Tests POSTing a comment without critical base fields. * * testPost() is testing with the most minimal normalization possible: the one diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index 62c8c6f2b2..6e34de2bf5 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -465,9 +465,9 @@ public function testGet() { // for the keys with the array order the same (it needs to match with // identical comparison). $expected = $this->getExpectedNormalizedEntity(); - $this->nestedKsort($expected); + ksort($expected); $actual = $this->serializer->decode((string) $response->getBody(), static::$format); - $this->nestedKsort($actual); + ksort($actual); $this->assertSame($expected, $actual); // Not only assert the normalization, also assert deserialization of the @@ -528,9 +528,9 @@ public function testGet() { // Config entities are not affected. // @see \Drupal\serialization\Normalizer\ConfigEntityNormalizer::normalize() $expected = static::castToString($expected); - $this->nestedKsort($expected); + ksort($expected); $actual = $this->serializer->decode((string) $response->getBody(), static::$format); - $this->nestedKsort($actual); + ksort($actual); $this->assertSame($expected, $actual); } @@ -1282,19 +1282,4 @@ protected function assertResourceNotAvailable(Url $url, array $request_options) } } - /** - * Sorts a nested array with ksort(). - * - * @param $array - * The nested array to sort. - */ - public static function nestedKsort(&$array) { - ksort($array); - foreach ($array as &$item) { - if (is_array($item)) { - static::nestedKsort($item); - } - } - } - } diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestExposedPropertyNormalizerTest.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestExposedPropertyNormalizerTest.php new file mode 100644 index 0000000000..ee88d9bb18 --- /dev/null +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestExposedPropertyNormalizerTest.php @@ -0,0 +1,87 @@ + 'value to expose', + 'exposed_value' => 'Exposed! value to expose', + ], + ]; + return $expected; + } + + /** + * {@inheritdoc} + */ + protected function createEntity() { + // If the exposed test field has not been created create it. + if (!FieldStorageConfig::loadByName('entity_test', 'field_test_exposed')) { + // Auto-create a field for testing. + FieldStorageConfig::create([ + 'entity_type' => 'entity_test', + 'field_name' => 'field_test_exposed', + 'type' => 'exposed_string_test', + 'cardinality' => 1, + 'translatable' => FALSE, + ])->save(); + FieldConfig::create([ + 'entity_type' => 'entity_test', + 'field_name' => 'field_test_exposed', + 'bundle' => 'entity_test', + 'label' => 'Test exposed-field', + ])->save(); + } + + $entity = parent::createEntity(); + $entity->field_test_exposed = [ + 'value' => 'value to expose', + ]; + $entity->save(); + return $entity; + } + + /** + * {@inheritdoc} + */ + protected function getNormalizedPostEntity() { + $post_entity = parent::getNormalizedPostEntity(); + $post_entity['field_test_exposed'] = [ + [ + 'value' => 'value to expose', + ], + ]; + return $post_entity; + } + +} diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestTextItemNormalizerTest.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestTextItemNormalizerTest.php deleted file mode 100644 index c563b5c61a..0000000000 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestTextItemNormalizerTest.php +++ /dev/null @@ -1,81 +0,0 @@ - 'Cádiz is the oldest continuously inhabited city in Spain and a nice place to spend a Sunday with friends.', - 'format' => 'plain_text', - 'process_result' => '

Cádiz is the oldest continuously inhabited city in Spain and a nice place to spend a Sunday with friends.

' . "\n", - ], - ]; - return $expected; - } - - /** - * {@inheritdoc} - */ - protected function createEntity() { - $entity = parent::createEntity(); - $entity->field_test_text = [ - 'value' => 'Cádiz is the oldest continuously inhabited city in Spain and a nice place to spend a Sunday with friends.', - 'format' => 'plain_text', - ]; - $entity->save(); - return $entity; - } - - /** - * {@inheritdoc} - */ - protected function getNormalizedPostEntity() { - $post_entity = parent::getNormalizedPostEntity(); - $post_entity['field_test_text'] = [ - [ - 'value' => 'Llamas are awesome.', - 'format' => 'plain_text', - ], - ]; - return $post_entity; - } - - /** - * {@inheritdoc} - */ - protected function getExpectedCacheTags() { - return Cache::mergeTags(['config:filter.format.plain_text'], parent::getExpectedCacheTags()); - } - - /** - * {@inheritdoc} - */ - protected function getExpectedCacheContexts() { - return Cache::mergeContexts(['languages:language_interface', 'theme'], parent::getExpectedCacheContexts()); - } - -} diff --git a/core/modules/rest/tests/src/Functional/EntityResource/Term/TermResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/Term/TermResourceTestBase.php index 4d6b3008a5..698451b58c 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/Term/TermResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/Term/TermResourceTestBase.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\rest\Functional\EntityResource\Term; -use Drupal\Core\Cache\Cache; use Drupal\taxonomy\Entity\Term; use Drupal\taxonomy\Entity\Vocabulary; use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase; @@ -65,7 +64,6 @@ protected function createEntity() { // Create a "Llama" taxonomy term. $term = Term::create(['vid' => $vocabulary->id()]) ->setName('Llama') - ->setDescription("It is a little known fact that llamas cannot count higher the seven.") ->setChangedTime(123456789); $term->save(); @@ -95,9 +93,8 @@ protected function getExpectedNormalizedEntity() { ], 'description' => [ [ - 'value' => 'It is a little known fact that llamas cannot count higher the seven.', + 'value' => NULL, 'format' => NULL, - 'process_result' => "

It is a little known fact that llamas cannot count higher the seven.

\n", ], ], 'parent' => [], @@ -162,18 +159,4 @@ protected function getExpectedUnauthorizedAccessMessage($method) { } } - /** - * {@inheritdoc} - */ - protected function getExpectedCacheTags() { - return Cache::mergeTags(parent::getExpectedCacheTags(), ['config:filter.format.plain_text', 'config:filter.settings']); - } - - /** - * {@inheritdoc} - */ - protected function getExpectedCacheContexts() { - return Cache::mergeContexts(['url.site'], $this->container->getParameter('renderer.config')['required_cache_contexts']); - } - } diff --git a/core/modules/serialization/tests/modules/field_normalization_test/field_normalization_test.services.yml b/core/modules/serialization/tests/modules/field_normalization_test/field_normalization_test.services.yml index 51fdd4a5fa..36243e7954 100644 --- a/core/modules/serialization/tests/modules/field_normalization_test/field_normalization_test.services.yml +++ b/core/modules/serialization/tests/modules/field_normalization_test/field_normalization_test.services.yml @@ -2,5 +2,5 @@ services: serializer.normalizer.silly_fielditem: class: Drupal\field_normalization_test\Normalization\TextItemSillyNormalizer tags: - # The priority must be higher than serializer.normalizer.text_item_base. - - { name: normalizer , priority: 30 } + # The priority must be higher than serialization.normalizer.field_item. + - { name: normalizer , priority: 9 } diff --git a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php index 094a8771d6..71fa6b3ec5 100644 --- a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php +++ b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php @@ -2,10 +2,8 @@ namespace Drupal\Tests\serialization\Kernel; -use Drupal\Component\Serialization\Json; use Drupal\Component\Utility\SafeMarkup; use Drupal\entity_test\Entity\EntityTestMulRev; -use Drupal\filter\Entity\FilterFormat; /** * Tests that entities can be serialized to supported core formats. @@ -62,29 +60,6 @@ protected function setUp() { // User create needs sequence table. $this->installSchema('system', ['sequences']); - // Create a text format because it is needed for TextItemBase normalization. - // @see \Drupal\text\Normalizer\TextItemBaseNormalizer::normalize(). - FilterFormat::create([ - 'format' => 'my_text_format', - 'name' => 'My Text Format', - 'filters' => [ - 'filter_html' => [ - 'module' => 'filter', - 'status' => TRUE, - 'weight' => 10, - 'settings' => [ - 'allowed_html' => '

', - ], - ], - 'filter_autop' => [ - 'module' => 'filter', - 'status' => TRUE, - 'weight' => 10, - 'settings' => [], - ], - ], - ])->save(); - // Create a test user to use as the entity owner. $this->user = \Drupal::entityManager()->getStorage('user')->create([ 'name' => 'serialization_test_user', @@ -94,13 +69,12 @@ protected function setUp() { $this->user->save(); // Create a test entity to serialize. - $test_text_value = $this->randomMachineName(); $this->values = [ 'name' => $this->randomMachineName(), 'user_id' => $this->user->id(), 'field_test_text' => [ - 'value' => $test_text_value, - 'format' => 'my_text_format', + 'value' => $this->randomMachineName(), + 'format' => 'full_html', ], ]; $this->entity = EntityTestMulRev::create($this->values); @@ -154,7 +128,6 @@ public function testNormalize() { [ 'value' => $this->values['field_test_text']['value'], 'format' => $this->values['field_test_text']['format'], - 'process_result' => "

{$this->values['field_test_text']['value']}

", ], ], ]; @@ -195,7 +168,7 @@ public function testSerialize() { // JsonEncoder. The output of ComplexDataNormalizer::normalize() is tested // elsewhere, so we can just assume that it works properly here. $normalized = $this->serializer->normalize($this->entity, 'json'); - $expected = Json::encode($normalized); + $expected = json_encode($normalized); // Test 'json'. $actual = $this->serializer->serialize($this->entity, 'json'); $this->assertIdentical($actual, $expected, 'Entity serializes to JSON when "json" is requested.'); @@ -220,7 +193,7 @@ public function testSerialize() { 'revision_id' => '' . $this->entity->getRevisionId() . '', 'default_langcode' => '1', 'non_rev_field' => '', - 'field_test_text' => '' . $this->values['field_test_text']['value'] . '' . $this->values['field_test_text']['format'] . '' . $this->values['field_test_text']['value'] . '

]]>
', + 'field_test_text' => '' . $this->values['field_test_text']['value'] . '' . $this->values['field_test_text']['format'] . '', ]; // Sort it in the same order as normalised. $expected = array_merge($normalized, $expected); diff --git a/core/modules/system/tests/modules/entity_test/config/schema/entity_test.data_types.schema.yml b/core/modules/system/tests/modules/entity_test/config/schema/entity_test.data_types.schema.yml new file mode 100644 index 0000000000..bda7a93205 --- /dev/null +++ b/core/modules/system/tests/modules/entity_test/config/schema/entity_test.data_types.schema.yml @@ -0,0 +1,15 @@ +# Schema for the configuration of the exposed string field type. + +field.storage_settings.exposed_string_test: + type: mapping + label: 'String settings' + mapping: + max_length: + type: integer + label: 'Maximum length' + case_sensitive: + type: boolean + label: 'Case sensitive' + is_ascii: + type: boolean + label: 'Contains US ASCII characters only' diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/DataType/ExposedStringData.php b/core/modules/system/tests/modules/entity_test/src/Plugin/DataType/ExposedStringData.php new file mode 100644 index 0000000000..946e4d2f1a --- /dev/null +++ b/core/modules/system/tests/modules/entity_test/src/Plugin/DataType/ExposedStringData.php @@ -0,0 +1,30 @@ +getParent(); + /** @var \Drupal\Core\TypedData\Plugin\DataType\StringData $string_value */ + $string_value = $item->get('value'); + return "Exposed! " . $string_value->getString(); + } + +} diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ExposedPropertyTestFieldItem.php b/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ExposedPropertyTestFieldItem.php new file mode 100644 index 0000000000..fb930826b2 --- /dev/null +++ b/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ExposedPropertyTestFieldItem.php @@ -0,0 +1,39 @@ +setLabel(new TranslatableMarkup('Text value exposed')) + ->setComputed(TRUE) + ->setClass(ExposedStringData::class) + ->setExposed(TRUE); + return $properties; + } + +} diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php index 06e3be4f21..6dd4339299 100644 --- a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php +++ b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php @@ -7,8 +7,6 @@ use Drupal\Core\Field\FieldItemBase; use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; -use Drupal\text\TextProcessed; -use Drupal\text\TextProcessedResult; /** * Base class for 'text' configurable field types. @@ -33,14 +31,6 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel ->setClass('\Drupal\text\TextProcessed') ->setSetting('text source', 'value'); - $properties['process_result'] = DataDefinition::create('string') - ->setLabel(t('Processed text (object)')) - ->setDescription(t('The text with the text format applied.')) - ->setComputed(TRUE) - ->setClass(TextProcessedResult::class) - ->setSetting('text source', 'value') - ->setExposed(TRUE); - return $properties; } @@ -67,7 +57,7 @@ public function isEmpty() { public function onChange($property_name, $notify = TRUE) { // Unset processed properties that are affected by the change. foreach ($this->definition->getPropertyDefinitions() as $property => $definition) { - if (in_array($definition->getClass(), [TextProcessed::class, TextProcessedResult::class], TRUE)) { + if ($definition->getClass() == '\Drupal\text\TextProcessed') { if ($property_name == 'format' || ($definition->getSetting('text source') == $property_name)) { $this->writePropertyValue($property, NULL); } diff --git a/core/modules/text/src/TextProcessed.php b/core/modules/text/src/TextProcessed.php index dd9c185952..61bef37dd5 100644 --- a/core/modules/text/src/TextProcessed.php +++ b/core/modules/text/src/TextProcessed.php @@ -2,8 +2,9 @@ namespace Drupal\text; -use Drupal\Core\Render\Markup; -use Drupal\filter\FilterProcessResult; +use Drupal\Core\TypedData\DataDefinitionInterface; +use Drupal\Core\TypedData\TypedDataInterface; +use Drupal\Core\TypedData\TypedData; /** * A computed property for processing text with a format. @@ -11,18 +12,56 @@ * Required settings (below the definition's 'settings' key) are: * - text source: The text property containing the to be processed text. */ -class TextProcessed extends TextProcessedResult { +class TextProcessed extends TypedData { + + /** + * Cached processed text. + * + * @var string|null + */ + protected $processed = NULL; + + /** + * {@inheritdoc} + */ + public function __construct(DataDefinitionInterface $definition, $name = NULL, TypedDataInterface $parent = NULL) { + parent::__construct($definition, $name, $parent); + + if ($definition->getSetting('text source') === NULL) { + throw new \InvalidArgumentException("The definition's 'text source' key has to specify the name of the text property to be processed."); + } + } /** * {@inheritdoc} */ public function getValue() { - $value = parent::getValue(); + if ($this->processed !== NULL) { + return $this->processed; + } + + $item = $this->getParent(); + $text = $item->{($this->definition->getSetting('text source'))}; - if ($value !== '' || ($value instanceof FilterProcessResult && $value->getProcessedText() !== '')) { - $value = Markup::create((string) $value); + // Avoid running check_markup() on empty strings. + if (!isset($text) || $text === '') { + $this->processed = ''; + } + else { + $this->processed = check_markup($text, $item->format, $item->getLangcode()); + } + return $this->processed; + } + + /** + * {@inheritdoc} + */ + public function setValue($value, $notify = TRUE) { + $this->processed = $value; + // Notify the parent of any changes. + if ($notify && isset($this->parent)) { + $this->parent->onChange($this->name); } - return $value; } } diff --git a/core/modules/text/src/TextProcessedResult.php b/core/modules/text/src/TextProcessedResult.php deleted file mode 100644 index a20d670bff..0000000000 --- a/core/modules/text/src/TextProcessedResult.php +++ /dev/null @@ -1,92 +0,0 @@ -getSetting('text source') === NULL) { - throw new \InvalidArgumentException("The definition's 'text source' key has to specify the name of the text property to be processed."); - } - } - - /** - * {@inheritdoc} - */ - public function getValue() { - if ($this->processed !== NULL) { - return $this->processed; - } - - /** @var \Drupal\Core\Field\FieldItemInterface $item */ - $item = $this->getParent(); - $text = $item->{($this->definition->getSetting('text source'))}; - - // Avoid running \Drupal\Core\Render\RendererInterface::renderPlain - // on empty strings. - if (!isset($text) || $text === '') { - $this->processed = ''; - } - else { - $build = [ - '#type' => 'processed_text', - '#text' => $text, - '#format' => $item->format, - '#filter_types_to_skip' => [], - '#langcode' => $item->getLangcode(), - ]; - // It's necessary to capture the cacheability metadata associated with the - // processed text. See https://www.drupal.org/node/2278483. - $processed_text = $this->getRenderer()->renderPlain($build); - $this->processed = FilterProcessResult::createFromRenderArray($build)->setProcessedText((string) $processed_text); - } - return $this->processed; - } - - /** - * {@inheritdoc} - */ - public function setValue($value, $notify = TRUE) { - $this->processed = $value; - // Notify the parent of any changes. - if ($notify && isset($this->parent)) { - $this->parent->onChange($this->name); - } - } - - /** - * Returns the renderer service. - * - * @return \Drupal\Core\Render\RendererInterface - */ - protected function getRenderer() { - return \Drupal::service('renderer'); - } - -} diff --git a/core/modules/text/tests/src/Kernel/TextWithSummaryItemTest.php b/core/modules/text/tests/src/Kernel/TextWithSummaryItemTest.php index fa9db4018d..a48c191b5e 100644 --- a/core/modules/text/tests/src/Kernel/TextWithSummaryItemTest.php +++ b/core/modules/text/tests/src/Kernel/TextWithSummaryItemTest.php @@ -81,8 +81,6 @@ public function testCrudAndUpdate() { // Change the format, this should update the processed properties. $entity->summary_field->format = 'no_filters'; - $entity->save(); - $entity = $storage->load($entity->id()); $this->assertEqual($entity->summary_field->processed, $value); $this->assertEqual($entity->summary_field->summary_processed, $summary);