Backport helper method for view blocks from 3.0

Related PR is #5385