Skip to content

Commit

Permalink
fix: don't list disabled suboccurrences (#2118)
Browse files Browse the repository at this point in the history
When generating an occurrence list, don't include suboccurrences that
are disabled. Any component processing should perform an equivalent
check but at present the suboccurrence still appears in the list.

The same doesn't happen to occurrences since the general flow logic
completely excludes any occurrence that is disabled.
  • Loading branch information
ml019 authored Jul 19, 2023
1 parent 40aa229 commit 534fb61
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions providers/shared/components/shared/setup.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,12 @@

[#macro shared_occurrences_state occurrence ]
[#local allOccurrences = asFlattenedArray( [ occurrence, occurrence.Occurrences![] ], true )]
[#list allOccurrences as occurrence ]

[#local occurrencestate = {}]
[#list occurrence as k, v ]
[#if k != "Occurrences" ]
[#local occurrencestate = mergeObjects(occurrencestate, { k : v }) ]
[/#if]
[/#list]

[#-- Only include enabled suboccurrences --]
[#list allOccurrences?filter(x -> x.Configuration.Solution.Enabled) as occurrence ]
[@stateEntry
type="Occurrences"
id=occurrence.Core.TypedFullName
state=occurrencestate
state=removeObjectAttributes(occurrence, "Occurrences")
/]
[/#list]
[/#macro]
Expand Down

0 comments on commit 534fb61

Please sign in to comment.