Without lazy ghost objects the injection worked fine, I expect the inject_on_load to work without having to ensure the entity is not a proxy or is initialized.
If not practically fixable in the bundle this regression should be documented or maybe because of the reliability issue inject_on_load should be replaced/removed.
Bug Report
Summary
inject_on_load
option doesn't work as previously expected when doctrine use lazy ghost objects (since doctrine/orm 3.0.0 or below when enabling them).According to https://github.com/doctrine/DoctrineBundle/issues/1651#issuecomment-1684297751 this might be an expected behavior of the new proxy internal (and might wontfix in doctrine) so this is why I address this issue here.
Current behavior
When accessing the file object on a uninitialized entity the file is not injected.
How to reproduce
Reproducible example : https://github.com/wryk/vich-uploader-issue-1439-lazy-ghost-inject-load
Expected behavior
Without lazy ghost objects the injection worked fine, I expect the
inject_on_load
to work without having to ensure the entity is not a proxy or is initialized.If not practically fixable in the bundle this regression should be documented or maybe because of the reliability issue
inject_on_load
should be replaced/removed.