Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
smart_date
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
smart_date
Merge requests
!134
Issue
#3458783
: Ensure the month limit is consistent with the field definition settings
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#3458783
: Ensure the month limit is consistent with the field definition settings
issue/smart_date-3458783:3458783-ensure-the-month
into
4.1.x
Overview
0
Commits
1
Pipelines
1
Changes
1
Open
codebymikey
requested to merge
issue/smart_date-3458783:3458783-ensure-the-month
into
4.1.x
10 months ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Closes
#3458783
0
0
Merge request reports
Compare
4.1.x
4.1.x (HEAD)
and
latest version
latest version
1054caa3
1 commit,
10 months ago
1 file
+
7
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
modules/smart_date_recur/src/SmartDateRecurTrait.php
+
7
−
2
Options
@@ -4,6 +4,7 @@ namespace Drupal\smart_date_recur;
use
Drupal\Core\StringTranslation\StringTranslationTrait
;
use
Drupal\smart_date
\SmartDateTrait
;
use
Drupal\smart_date_recur
\Entity\SmartDateRule
;
/**
* Provides friendly methods for smart date range.
@@ -224,8 +225,12 @@ trait SmartDateRecurTrait {
* Retrieve the months_limit value from the field definition.
*/
public
function
getMonthsLimit
(
$field_def
)
{
$month_limit
=
$this
->
getThirdPartyFallback
(
$field_def
,
'month_limit'
,
12
);
return
$month_limit
;
if
((
$field_def
instanceof
SmartDateRule
)
&&
$parent_entity
=
$field_def
->
getParentEntity
())
{
/** @var \Drupal\Core\Entity\FieldableEntityInterface $parent_entity */
$field_name
=
$field_def
->
get
(
'field_name'
)
->
value
;
$field_def
=
$parent_entity
->
getFieldDefinition
(
$field_name
);
}
return
$this
->
getThirdPartyFallback
(
$field_def
,
'month_limit'
,
12
);
}
/**
Loading