Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
e112c456
Commit
e112c456
authored
Sep 30, 2012
by
Angie Byron
Browse files
Issue
#1798382
by Berdir: Fixed Random Test failures in Entity translation tests.
parent
43942f8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Entity/Field/Type/EntityReferenceItem.php
View file @
e112c456
...
...
@@ -68,7 +68,7 @@ public function setValue($values) {
// Entity is computed out of the ID, so we only need to update the ID. Only
// set the entity field if no ID is given.
if
(
!
empty
(
$values
[
'value'
]))
{
if
(
isset
(
$values
[
'value'
]))
{
$this
->
properties
[
'value'
]
->
setValue
(
$values
[
'value'
]);
}
else
{
...
...
core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
View file @
e112c456
...
...
@@ -220,6 +220,16 @@ public function testReadWrite() {
$this
->
assertEqual
(
$values
[
'name'
],
array
(
0
=>
array
(
'value'
=>
'bar'
)),
'Field value has been retrieved via getPropertyValue() from an entity.'
);
$entity
->
setPropertyValues
(
array
(
'name'
=>
'foo'
));
$this
->
assertEqual
(
$entity
->
name
->
value
,
'foo'
,
'Field value has been set via setPropertyValue() on an entity.'
);
// Make sure the user id can be set to zero.
$user_item
[
0
][
'value'
]
=
0
;
$entity
=
entity_create
(
'entity_test'
,
array
(
'name'
=>
$name_item
,
'user_id'
=>
$user_item
,
'field_test_text'
=>
$text_item
,
));
$this
->
assertNotNull
(
$entity
->
user_id
->
value
,
'User id is not NULL'
);
$this
->
assertIdentical
(
$entity
->
user_id
->
value
,
0
,
'User id has been set to 0'
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment