Fix EZP-21565: Workflow: restore object will cause fatal error

https://jira.ez.no/browse/EZP-21565

The issue was similar to [EZP-20558](https://jira.ez.no/browse/EZP-20558), which was a regression from [EZP-19660](https://jira.ez.no/browse/EZP-19660).

Approach is similar. See https://github.com/ezsystems/ezpublish-legacy/pull/581

Manual testing.