Issue #1762106 by rootatwc, zerbash, sunchaser fix for invalid foreach() and clone links not shown for non-admins