Merge pull request #10256 from tchak/fix-champs-without-row_id-in-repetitions
fix(champ): do not expose champs without row_id in repetitions
This commit is contained in:
commit
6e78dc60cd
1 changed files with 8 additions and 3 deletions
|
@ -1158,10 +1158,15 @@ class Dossier < ApplicationRecord
|
|||
.transform_values { _1.sort_by(&:id).uniq(&:row_id) }
|
||||
|
||||
if scope.is_a?(TypeDeChamp)
|
||||
revision.children_of(scope)
|
||||
revision
|
||||
.children_of(scope)
|
||||
.flat_map { champs_index[_1.stable_id] || [] }
|
||||
.filter(&:child?) # TODO: remove once bad data (child champ without a row id) is cleaned
|
||||
else
|
||||
revision.types_de_champ_for(scope:, root:)
|
||||
end.flat_map { champs_index[_1.stable_id] || [] }
|
||||
revision
|
||||
.types_de_champ_for(scope:, root:)
|
||||
.flat_map { champs_index[_1.stable_id] || [] }
|
||||
end
|
||||
end
|
||||
|
||||
def has_annotations?
|
||||
|
|
Loading…
Reference in a new issue