Merge pull request #10325 from colinux/fix-add-row-without-champ
Tech: pas d'erreur si un usager essaie d'ajouter une ligne d'un champ répétition sans enfant
This commit is contained in:
commit
7163571764
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ class Champs::RepetitionController < ApplicationController
|
||||||
row = @champ.add_row(@champ.dossier.revision)
|
row = @champ.add_row(@champ.dossier.revision)
|
||||||
@first_champ_id = row.map(&:focusable_input_id).compact.first
|
@first_champ_id = row.map(&:focusable_input_id).compact.first
|
||||||
@row_id = row.first&.row_id
|
@row_id = row.first&.row_id
|
||||||
@row_number = @champ.row_ids.find_index(@row_id) + 1
|
@row_number = @row_id.nil? ? 0 : @champ.row_ids.find_index(@row_id) + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove
|
def remove
|
||||||
|
|
Loading…
Reference in a new issue