Don't process unpublished element

Whitescreen can be caused when you have an UNPUBLISHED element which is
invalid (e.g. calc with invalid calculation).

This fix checks that the element is published and if not returns without
trying to provide data.

(Fix to prevent whitescreen on published element is another matter).