[T2218] [FIX] avoids multiple calls to next_by_id

Merged Javier Vescio requested to merge T2218 into 15.0-preStable

Merge request reports