[T2218] [FIX] avoids multiple calls to next_by_id

Closed Javier Vescio requested to merge T2218 into 15.0-v2

Merge request reports