Do not filter out unpublished pages if in draft mode

also invalidate menu cache when turning edit mode on/off
Fixes #2483