Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduler-3373860
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
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
scheduler-3373860
Commits
86368578
Commit
86368578
authored
2 years ago
by
Jonathan Smith
Committed by
Jonathan Smith
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3282982
by DieterHolvoet, jonathan1055: Cater for adding the first entity bundle
parent
385a52f2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/SchedulerPluginBase.php
+13
-4
13 additions, 4 deletions
src/SchedulerPluginBase.php
with
13 additions
and
4 deletions
src/SchedulerPluginBase.php
+
13
−
4
View file @
86368578
...
...
@@ -188,7 +188,7 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin
return
$this
->
entityFormIds
;
}
return
$this
->
entityFormIds
=
$this
->
entityFormIdsByType
(
$this
->
entityType
());
return
$this
->
entityFormIds
=
$this
->
entityFormIdsByType
(
$this
->
entityType
()
,
FALSE
);
}
/**
...
...
@@ -203,7 +203,7 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin
->
getDefinition
(
$this
->
entityType
())
->
getBundleEntityType
();
return
$this
->
entityTypeFormIds
=
$this
->
entityFormIdsByType
(
$bundleEntityType
);
return
$this
->
entityTypeFormIds
=
$this
->
entityFormIdsByType
(
$bundleEntityType
,
TRUE
);
}
/**
...
...
@@ -211,9 +211,14 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin
*
* The logic for this function is based on EntityForm::getFormId.
*
* @param string $entityType
* The entity type for which to return the form ids.
* @param bool $isBundle
* TRUE if this is the entity type/bundle form.
*
* @see \Drupal\Core\Entity\EntityForm::getFormId()
*/
protected
function
entityFormIdsByType
(
string
$entityType
):
array
{
protected
function
entityFormIdsByType
(
string
$entityType
,
bool
$isBundle
):
array
{
$ids
=
[];
$definition
=
$this
->
entityTypeManager
->
getDefinition
(
$entityType
);
$operations
=
[];
...
...
@@ -231,7 +236,11 @@ abstract class SchedulerPluginBase extends PluginBase implements SchedulerPlugin
$operations
[]
=
'edit'
;
}
$types
=
array_keys
(
$this
->
getTypes
());
// When creating the first type/bundle there will be nothing returned for
// $this->getTypes(). This is only a problem when getting the 'type' forms,
// which do not actually need the list of types anyway. Hence for this case
// we need an element in $types, one is enough and it can be anything.
$types
=
$isBundle
?
[
''
]
:
array_keys
(
$this
->
getTypes
());
foreach
(
$types
as
$typeId
)
{
foreach
(
$operations
as
$operation
)
{
$form_id
=
$entityType
;
...
...
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