oroinc / platform

Main OroPlatform package with core functionality.
Other
627 stars 351 forks source link

Sending email with EmailModelSender throws an error after the update to 5.1.3 #1109

Open yaroslavbr opened 6 months ago

yaroslavbr commented 6 months ago

Summary

Steps to reproduce

1

Actual Result Getting an exception: Uncaught Error: Call to a member function getId() on null {"exception":"[object] (Error(code: 0): Call to a member function getId() on null at /var/domains/zinkunie-zinkunie-upgrade.test-madia.nl /releases/175/vendor/oro/platform/src/Oro/Bundle/ EmailBundle/Entity/Manager/EmailAddressVisibilityManager.php:55)"}

This is caused because code is trying to access EmailUser::Organization::id while organization is actually empty. Please look at the xdebug screen how EmailUser look like:

2

Considering EmailUser entity is created by oro from EmailOrigin which I also did not provide by my own. I think this is oro internal bug.

Expected Result
Email sending using EmailModelSender::send() while providing only on Email Model as an argument should work.

Details about your environment