fixes #4048 Bad SQL error for non existence content on workflow tasks