Fix EZP-23348: Misleading error message on deleted embed objects

4.x version of the fix. Templates have been added to ezoe so the patch can be used as is.