Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
state_machine
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Drupal.org issue queue
Drupal.org issue queue
Security & Compliance
Security & Compliance
Dependency List
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
project
state_machine
Commits
d6d02e49
Commit
d6d02e49
authored
Dec 17, 2015
by
bojanz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Account for StateItem::setValue() receiving a scalar.
parent
7eb6e188
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/Plugin/Field/FieldType/StateItem.php
src/Plugin/Field/FieldType/StateItem.php
+4
-0
No files found.
src/Plugin/Field/FieldType/StateItem.php
View file @
d6d02e49
...
...
@@ -142,6 +142,10 @@ class StateItem extends FieldItemBase implements StateItemInterface, OptionsProv
*/
public
function
setValue
(
$values
,
$notify
=
TRUE
)
{
if
(
empty
(
$this
->
initialValue
))
{
// If no array is given, then the method received just the state value.
if
(
isset
(
$values
)
&&
!
is_array
(
$values
))
{
$values
=
[
'value'
=>
$values
];
}
// Track the initial field value to allow isValid() to validate changes.
$this
->
initialValue
=
$values
[
'value'
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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