Skip to content
Snippets Groups Projects
Commit 16591856 authored by Claudiu Cristea's avatar Claudiu Cristea
Browse files

Issue #3425308 by claudiu.cristea: Temporary hack for #3425226

parent 80c074b7
No related branches found
No related tags found
No related merge requests found
......@@ -32,16 +32,20 @@ class RdfSyncUriFieldItemList extends FieldItemList {
}
}
/**
* {@inheritdoc}
*/
public function setValue($values, $notify = TRUE): void {
if (!$this->getEntity()->isNew()) {
@trigger_error("Setting the '{$this->getName()}' field is possible only for new entities. Original value is preserved", E_USER_NOTICE);
return;
}
parent::setValue($values, $notify);
}
// @todo Re-enable this feature when https://www.drupal.org/i/3425226 lands.
// @see https://www.drupal.org/i/3425226
// phpcs:disable
// /**
// * {@inheritdoc}
// */
// public function setValue($values, $notify = TRUE): void {
// if (!$this->getEntity()->isNew()) {
// @trigger_error("Setting the '{$this->getName()}' field is possible only for new entities. Original value is preserved", E_USER_NOTICE);
// return;
// }
// parent::setValue($values, $notify);
// }
// phpcs:enable
/**
* {@inheritdoc}
......
......@@ -66,9 +66,13 @@ class RdfSyncTest extends KernelTestBase {
$term = Term::load($term->id());
$this->assertSame($expected, $term->get('uri')->value);
// @todo Re-enable this feature when https://www.drupal.org/i/3425226 lands.
// @see https://www.drupal.org/i/3425226
// phpcs:disable
// Check that the URI cannot be set on a saved entity.
$term->set('uri', 'http://example.com');
$this->assertSame($expected, $term->get('uri')->value);
// $term->set('uri', 'http://example.com');
// $this->assertSame($expected, $term->get('uri')->value);
// phpcs:enable
// Check loading the entity by URI.
$entity = $this->container->get('rdf_sync.mapper')->getEntityByUri($term->get('uri')->value);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment