Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rdf_sync-3490691
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
rdf_sync-3490691
Commits
16591856
Commit
16591856
authored
10 months ago
by
Claudiu Cristea
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3425308
by claudiu.cristea: Temporary hack for
#3425226
parent
80c074b7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/RdfSyncUriFieldItemList.php
+14
-10
14 additions, 10 deletions
src/RdfSyncUriFieldItemList.php
tests/src/Kernel/RdfSyncTest.php
+6
-2
6 additions, 2 deletions
tests/src/Kernel/RdfSyncTest.php
with
20 additions
and
12 deletions
src/RdfSyncUriFieldItemList.php
+
14
−
10
View file @
16591856
...
...
@@ -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}
...
...
This diff is collapsed.
Click to expand it.
tests/src/Kernel/RdfSyncTest.php
+
6
−
2
View file @
16591856
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment