Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3338541
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
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
drupal-3338541
Commits
8ee82f21
Commit
8ee82f21
authored
8 years ago
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2788521
by david.gil, SteffenR: hook_options_list_alter sample fails on 8.1.8
parent
8d783b7c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/options/options.api.php
+2
-2
2 additions, 2 deletions
core/modules/options/options.api.php
with
2 additions
and
2 deletions
core/modules/options/options.api.php
+
2
−
2
View file @
8ee82f21
...
...
@@ -20,7 +20,7 @@
* properties.
* @param array $context
* An associative array containing:
* - field
_d
efinition: The field definition
* - field
D
efinition: The field definition
* (\Drupal\Core\Field\FieldDefinitionInterface).
* - entity: The entity object the field is attached to
* (\Drupal\Core\Entity\EntityInterface).
...
...
@@ -30,7 +30,7 @@
*/
function
hook_options_list_alter
(
array
&
$options
,
array
$context
)
{
// Check if this is the field we want to change.
if
(
$context
[
'field'
]
->
id
()
==
'field_option'
)
{
if
(
$context
[
'field
Definition
'
]
->
id
()
==
'field_option'
)
{
// Change the label of the empty option.
$options
[
'_none'
]
=
t
(
'== Empty =='
);
}
...
...
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