Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rng
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
rng
Commits
3a503887
Commit
3a503887
authored
9 years ago
by
dpi
Browse files
Options
Downloads
Patches
Plain Diff
Fixed: errors display when field_ui module is not enabled.
parent
18220536
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Lists/EventTypeListBuilder.php
+14
-12
14 additions, 12 deletions
src/Lists/EventTypeListBuilder.php
src/Tests/EventTypeTest.php
+4
-2
4 additions, 2 deletions
src/Tests/EventTypeTest.php
with
18 additions
and
14 deletions
src/Lists/EventTypeListBuilder.php
+
14
−
12
View file @
3a503887
...
...
@@ -58,19 +58,21 @@ class EventTypeListBuilder extends ConfigEntityListBuilder {
/** @var \Drupal\rng\EventTypeInterface $entity **/
$operations
=
parent
::
getDefaultOperations
(
$entity
);
$entity_type
=
\Drupal
::
entityManager
()
->
getDefinition
(
$entity
->
getEventEntityTypeId
());
if
(
$entity_type
->
get
(
'field_ui_base_route'
))
{
$options
=
[];
if
(
$entity_type
->
getBundleEntityType
()
!==
'bundle'
)
{
$options
[
$entity_type
->
getBundleEntityType
()]
=
$entity
->
getEventBundle
();
if
(
$this
->
moduleHandler
->
moduleExists
(
'field_ui'
))
{
$entity_type
=
\Drupal
::
entityManager
()
->
getDefinition
(
$entity
->
getEventEntityTypeId
());
if
(
$entity_type
->
get
(
'field_ui_base_route'
))
{
$options
=
[];
if
(
$entity_type
->
getBundleEntityType
()
!==
'bundle'
)
{
$options
[
$entity_type
->
getBundleEntityType
()]
=
$entity
->
getEventBundle
();
}
$operations
[
'manage-fields'
]
=
[
'title'
=>
t
(
'Event setting defaults'
),
'weight'
=>
15
,
'url'
=>
Url
::
fromRoute
(
"entity."
.
$entity
->
getEventEntityTypeId
()
.
".field_ui_fields"
,
$options
),
];
}
$operations
[
'manage-fields'
]
=
[
'title'
=>
t
(
'Event setting defaults'
),
'weight'
=>
15
,
'url'
=>
Url
::
fromRoute
(
"entity."
.
$entity
->
getEventEntityTypeId
()
.
".field_ui_fields"
,
$options
),
];
}
return
$operations
;
...
...
This diff is collapsed.
Click to expand it.
src/Tests/EventTypeTest.php
+
4
−
2
View file @
3a503887
...
...
@@ -19,7 +19,7 @@ use Drupal\Core\Url;
*/
class
EventTypeTest
extends
RNGTestBase
{
public
static
$modules
=
array
(
'node'
);
public
static
$modules
=
array
(
'node'
,
'field_ui'
);
function
testEventType
()
{
$web_user
=
$this
->
drupalCreateUser
([
'administer event types'
,
'access administration pages'
]);
...
...
@@ -63,7 +63,9 @@ class EventTypeTest extends RNGTestBase {
// Event type list
$this
->
assertUrl
(
'admin/config/rng/event_types'
,
[],
'Browser was redirected to event type list.'
);
$this
->
assertRaw
(
'<td>node.event</td>'
,
'Event Type shows in list'
);
$this
->
assertRaw
(
'<td>Content: event</td>'
,
'Event Type shows in list'
);
$options
=
[
'node_type'
=>
'event'
];
$this
->
assertLinkByHref
(
Url
::
fromRoute
(
"entity.node.field_ui_fields"
,
$options
)
->
toString
());
// Edit form
$edit
=
[];
...
...
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