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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!4294
An error occurred while fetching the assigned milestone of the selected merge_request.
Issue
#2546212
: Entity view/form mode formatter/widget settings have no translation UI
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#2546212
: Entity view/form mode formatter/widget settings have no translation UI
issue/drupal-2546212:2546212-entity-viewform-mode-11-x
into
11.x
Overview
84
Commits
3
Pipelines
27
Changes
12
Open
Tavi Toporjinschi
requested to merge
issue/drupal-2546212:2546212-entity-viewform-mode-11-x
into
11.x
1 year ago
Overview
21
Commits
3
Pipelines
27
Changes
12
Expand
0
0
Merge request reports
Compare
11.x
version 64
8d206d1d
2 months ago
version 63
fa19ecb6
2 months ago
version 62
5f8de937
2 months ago
version 61
e862d74f
4 months ago
version 60
904a7512
4 months ago
version 59
7ac6845e
5 months ago
version 58
a6053c6d
5 months ago
version 57
300f96b5
5 months ago
version 56
4dddf024
1 year ago
version 55
9e098741
1 year ago
version 54
8925a6ad
1 year ago
version 53
817cff72
1 year ago
version 52
025c1037
1 year ago
version 51
68a5fed2
1 year ago
version 50
983e1d78
1 year ago
version 49
a9d3fbf6
1 year ago
version 48
a905fb92
1 year ago
version 47
ab33a24f
1 year ago
version 46
b29bf357
1 year ago
version 45
a534cda0
1 year ago
version 44
70d49506
1 year ago
version 43
1e5d89d0
1 year ago
version 42
96dcf68f
1 year ago
version 41
b47c037f
1 year ago
version 40
04865d03
1 year ago
version 39
713746dd
1 year ago
version 38
5a28c66a
1 year ago
version 37
f963ea1d
1 year ago
version 36
1aceaec0
1 year ago
version 35
af046a6d
1 year ago
version 34
8a890346
1 year ago
version 33
ad4ff617
1 year ago
version 32
e61d3a93
1 year ago
version 31
69e8c3e8
1 year ago
version 30
76a1d748
1 year ago
version 29
aac72c0a
1 year ago
version 28
00eb88e0
1 year ago
version 27
d901dfa1
1 year ago
version 26
d4a78836
1 year ago
version 25
1b807c70
1 year ago
version 24
2b2bee3e
1 year ago
version 23
11e77ed4
1 year ago
version 22
f334ab57
1 year ago
version 21
1021fa59
1 year ago
version 20
e6239382
1 year ago
version 19
69ae5ef6
1 year ago
version 18
2a92d5d1
1 year ago
version 17
9ccb9bb7
1 year ago
version 16
059dc4b6
1 year ago
version 15
c52cebdb
1 year ago
version 14
7054c777
1 year ago
version 13
f51cf2e9
1 year ago
version 12
9a97c4de
1 year ago
version 11
5253699d
1 year ago
version 10
cfc984a7
1 year ago
version 9
54018a20
1 year ago
version 8
39788e7b
1 year ago
version 7
031993ef
1 year ago
version 6
af3be3fa
1 year ago
version 5
d89f7412
1 year ago
version 4
8f740811
1 year ago
version 3
a5755ea6
1 year ago
version 2
cf94852c
1 year ago
version 1
a45a855c
1 year ago
11.x (HEAD)
and
latest version
latest version
571d9179
3 commits,
1 month ago
version 64
8d206d1d
3 commits,
2 months ago
version 63
fa19ecb6
2 commits,
2 months ago
version 62
5f8de937
1 commit,
2 months ago
version 61
e862d74f
57 commits,
4 months ago
version 60
904a7512
56 commits,
4 months ago
version 59
7ac6845e
55 commits,
5 months ago
version 58
a6053c6d
54 commits,
5 months ago
version 57
300f96b5
53 commits,
5 months ago
version 56
4dddf024
52 commits,
1 year ago
version 55
9e098741
51 commits,
1 year ago
version 54
8925a6ad
50 commits,
1 year ago
version 53
817cff72
49 commits,
1 year ago
version 52
025c1037
49 commits,
1 year ago
version 51
68a5fed2
49 commits,
1 year ago
version 50
983e1d78
49 commits,
1 year ago
version 49
a9d3fbf6
49 commits,
1 year ago
version 48
a905fb92
48 commits,
1 year ago
version 47
ab33a24f
48 commits,
1 year ago
version 46
b29bf357
48 commits,
1 year ago
version 45
a534cda0
47 commits,
1 year ago
version 44
70d49506
46 commits,
1 year ago
version 43
1e5d89d0
46 commits,
1 year ago
version 42
96dcf68f
45 commits,
1 year ago
version 41
b47c037f
44 commits,
1 year ago
version 40
04865d03
43 commits,
1 year ago
version 39
713746dd
42 commits,
1 year ago
version 38
5a28c66a
42 commits,
1 year ago
version 37
f963ea1d
41 commits,
1 year ago
version 36
1aceaec0
40 commits,
1 year ago
version 35
af046a6d
38 commits,
1 year ago
version 34
8a890346
37 commits,
1 year ago
version 33
ad4ff617
36 commits,
1 year ago
version 32
e61d3a93
35 commits,
1 year ago
version 31
69e8c3e8
34 commits,
1 year ago
version 30
76a1d748
33 commits,
1 year ago
version 29
aac72c0a
31 commits,
1 year ago
version 28
00eb88e0
29 commits,
1 year ago
version 27
d901dfa1
28 commits,
1 year ago
version 26
d4a78836
27 commits,
1 year ago
version 25
1b807c70
26 commits,
1 year ago
version 24
2b2bee3e
25 commits,
1 year ago
version 23
11e77ed4
23 commits,
1 year ago
version 22
f334ab57
22 commits,
1 year ago
version 21
1021fa59
20 commits,
1 year ago
version 20
e6239382
19 commits,
1 year ago
version 19
69ae5ef6
18 commits,
1 year ago
version 18
2a92d5d1
17 commits,
1 year ago
version 17
9ccb9bb7
17 commits,
1 year ago
version 16
059dc4b6
16 commits,
1 year ago
version 15
c52cebdb
16 commits,
1 year ago
version 14
7054c777
15 commits,
1 year ago
version 13
f51cf2e9
11 commits,
1 year ago
version 12
9a97c4de
10 commits,
1 year ago
version 11
5253699d
9 commits,
1 year ago
version 10
cfc984a7
8 commits,
1 year ago
version 9
54018a20
7 commits,
1 year ago
version 8
39788e7b
10 commits,
1 year ago
version 7
031993ef
8 commits,
1 year ago
version 6
af3be3fa
7 commits,
1 year ago
version 5
d89f7412
6 commits,
1 year ago
version 4
8f740811
5 commits,
1 year ago
version 3
a5755ea6
3 commits,
1 year ago
version 2
cf94852c
2 commits,
1 year ago
version 1
a45a855c
1 commit,
1 year ago
12 files
+
946
−
102
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
12
Search (e.g. *.vue) (Ctrl+P)
core/modules/config_translation/src/Controller/BundleAwareConfigEntityListBuilder.php
0 → 100644
+
118
−
0
Options
<?php
namespace
Drupal\config_translation\Controller
;
use
Drupal\Core\Entity\EntityStorageInterface
;
use
Drupal\Core\Entity\EntityTypeBundleInfoInterface
;
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\Core\Entity\EntityTypeManagerInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Defines the config translation list builder for field entities.
*/
abstract
class
BundleAwareConfigEntityListBuilder
extends
ConfigTranslationEntityListBuilder
{
/**
* The name of the entity type the configs are attached to.
*
* @var string
*/
protected
$baseEntityType
=
''
;
/**
* An array containing the base entity type's definition.
*
* @var \Drupal\Core\Entity\EntityTypeInterface
*/
protected
$baseEntityInfo
;
/**
* The bundles info for the base entity type.
*
* @var array
*/
protected
$baseEntityBundles
=
[];
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected
$entityTypeManager
;
/**
* The entity bundle info.
*
* @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface
*/
protected
$entityTypeBundleInfo
;
/**
* {@inheritdoc}
*/
public
static
function
createInstance
(
ContainerInterface
$container
,
EntityTypeInterface
$entity_type
)
{
$entity_type_manager
=
$container
->
get
(
'entity_type.manager'
);
$entity_type_bundle_info
=
$container
->
get
(
'entity_type.bundle.info'
);
return
new
static
(
$entity_type
,
$entity_type_manager
->
getStorage
(
$entity_type
->
id
()),
$entity_type_manager
,
$entity_type_bundle_info
);
}
/**
* Constructs a new ConfigTranslationFieldListBuilder object.
*
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The entity type definition.
* @param \Drupal\Core\Entity\EntityStorageInterface $storage
* The entity storage class.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
* The entity type bundle info.
*/
public
function
__construct
(
EntityTypeInterface
$entity_type
,
EntityStorageInterface
$storage
,
EntityTypeManagerInterface
$entity_type_manager
,
EntityTypeBundleInfoInterface
$entity_type_bundle_info
)
{
parent
::
__construct
(
$entity_type
,
$storage
);
$this
->
entityTypeManager
=
$entity_type_manager
;
$this
->
entityTypeBundleInfo
=
$entity_type_bundle_info
;
}
/**
* {@inheritdoc}
*/
public
function
setMapperDefinition
(
$mapper_definition
)
{
$this
->
baseEntityType
=
$mapper_definition
[
'base_entity_type'
];
$this
->
baseEntityInfo
=
$this
->
entityTypeManager
->
getDefinition
(
$this
->
baseEntityType
);
$this
->
baseEntityBundles
=
$this
->
entityTypeBundleInfo
->
getBundleInfo
(
$this
->
baseEntityType
);
return
$this
;
}
/**
* Controls the visibility of the bundle column on field list pages.
*
* @return bool
* Whenever the bundle is displayed or not.
*/
public
function
displayBundle
()
{
// The bundle key is explicitly defined in the entity definition.
if
(
$this
->
baseEntityInfo
->
getKey
(
'bundle'
))
{
return
TRUE
;
}
// There is more than one bundle defined.
if
(
count
(
$this
->
baseEntityBundles
)
>
1
)
{
return
TRUE
;
}
// The defined bundle ones not match the entity type name.
if
(
!
empty
(
$this
->
baseEntityBundles
)
&&
!
isset
(
$this
->
baseEntityBundles
[
$this
->
baseEntityType
]))
{
return
TRUE
;
}
return
FALSE
;
}
}
Loading