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).
Merge pull request #752 from Sophist-UK/sophist_fix_white_screen_on_unpublished_element

Don't process unpublished element