Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
recurring_events-3312242
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
recurring_events-3312242
Commits
10418f1c
Commit
10418f1c
authored
5 years ago
by
Owen Bush
Browse files
Options
Downloads
Patches
Plain Diff
Fixing bug with creating events under some circumstances
parent
87006c0a
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/Plugin/FieldInheritance/FieldInheritancePluginBase.php
+22
-5
22 additions, 5 deletions
src/Plugin/FieldInheritance/FieldInheritancePluginBase.php
with
22 additions
and
5 deletions
src/Plugin/FieldInheritance/FieldInheritancePluginBase.php
+
22
−
5
View file @
10418f1c
...
...
@@ -148,6 +148,9 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh
*/
protected
function
inheritData
()
{
$series
=
$this
->
getEventSeries
();
if
(
$series
===
FALSE
)
{
return
[];
}
return
$series
->
{
$this
->
getSourceField
()}
->
getValue
()
??
''
;
}
...
...
@@ -160,8 +163,12 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh
protected
function
prependData
()
{
$series
=
$this
->
getEventSeries
();
$instance
=
$this
->
getEventInstance
();
$values
=
[];
if
(
$series
===
FALSE
)
{
return
$values
;
}
if
(
!
empty
(
$instance
->
{
$this
->
getEntityField
()}
->
getValue
()))
{
$values
=
array_merge
(
$values
,
$instance
->
{
$this
->
getEntityField
()}
->
getValue
());
}
...
...
@@ -180,8 +187,12 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh
protected
function
appendData
()
{
$series
=
$this
->
getEventSeries
();
$instance
=
$this
->
getEventInstance
();
$values
=
[];
if
(
$series
===
FALSE
)
{
return
$values
;
}
if
(
!
empty
(
$series
->
{
$this
->
getSourceField
()}
->
getValue
()))
{
$values
=
array_merge
(
$values
,
$series
->
{
$this
->
getSourceField
()}
->
getValue
());
}
...
...
@@ -200,9 +211,12 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh
protected
function
fallbackData
()
{
$series
=
$this
->
getEventSeries
();
$instance
=
$this
->
getEventInstance
();
$values
=
[];
if
(
$series
===
FALSE
)
{
return
$values
;
}
if
(
!
empty
(
$instance
->
{
$this
->
getEntityField
()}
->
getValue
()))
{
$values
=
$instance
->
{
$this
->
getEntityField
()}
->
getValue
();
}
...
...
@@ -243,11 +257,14 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh
/**
* Get the translated eventseries entity.
*
* @return Drupal\Core\Entity\EntityInterface
* The translated eventseries entity.
* @return Drupal\Core\Entity\EntityInterface
|bool
* The translated eventseries entity
, or FALSE
.
*/
protected
function
getEventSeries
()
{
$series
=
$this
->
entity
->
getEventSeries
();
if
(
empty
(
$series
))
{
return
FALSE
;
}
if
(
$series
->
hasTranslation
(
$this
->
langCode
))
{
return
$series
->
getTranslation
(
$this
->
langCode
);
}
...
...
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