Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
6315275a
Commit
6315275a
authored
Nov 17, 2015
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2607294
by andypost: Fix entity.api bundle examples
parent
50de1d6d
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/lib/Drupal/Core/Entity/entity.api.php
+5
-5
5 additions, 5 deletions
core/lib/Drupal/Core/Entity/entity.api.php
with
5 additions
and
5 deletions
core/lib/Drupal/Core/Entity/entity.api.php
+
5
−
5
View file @
6315275a
...
...
@@ -1916,16 +1916,16 @@ function hook_entity_extra_field_info() {
// Visibility of the ordering of the language selector is the same as on the
// node/add form.
if
(
$module_language_enabled
)
{
$configuration
=
ContentLanguageSettings
::
loadByEntityTypeBundle
(
'node'
,
$bundle
->
type
);
$configuration
=
ContentLanguageSettings
::
loadByEntityTypeBundle
(
'node'
,
$bundle
->
id
()
);
if
(
$configuration
->
isLanguageAlterable
())
{
$extra
[
'node'
][
$bundle
->
type
][
'form'
][
'language'
]
=
array
(
$extra
[
'node'
][
$bundle
->
id
()
][
'form'
][
'language'
]
=
array
(
'label'
=>
t
(
'Language'
),
'description'
=>
$description
,
'weight'
=>
0
,
);
}
}
$extra
[
'node'
][
$bundle
->
type
][
'display'
][
'language'
]
=
array
(
$extra
[
'node'
][
$bundle
->
id
()
][
'display'
][
'language'
]
=
array
(
'label'
=>
t
(
'Language'
),
'description'
=>
$description
,
'weight'
=>
0
,
...
...
@@ -1948,8 +1948,8 @@ function hook_entity_extra_field_info() {
function
hook_entity_extra_field_info_alter
(
&
$info
)
{
// Force node title to always be at the top of the list by default.
foreach
(
NodeType
::
loadMultiple
()
as
$bundle
)
{
if
(
isset
(
$info
[
'node'
][
$bundle
->
type
][
'form'
][
'title'
]))
{
$info
[
'node'
][
$bundle
->
type
][
'form'
][
'title'
][
'weight'
]
=
-
20
;
if
(
isset
(
$info
[
'node'
][
$bundle
->
id
()
][
'form'
][
'title'
]))
{
$info
[
'node'
][
$bundle
->
id
()
][
'form'
][
'title'
][
'weight'
]
=
-
20
;
}
}
}
...
...
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
sign in
to comment