Issue #2868185 by Berdir, dawehner: $entity->toUrl() call in hook_entity_view() breaks preview of new entities