Fix for #4314. Search article/category id in cycle