Fixed EZP-18195: $result.object is not correctly created

Depends on: https://github.com/ezsystems/ezpublish-legacy/pull/586