Open artemvd opened 1 year ago
If the entity has been requested in a specific translation, that the entity does not have then I agree that the return value should be NULL since we cannot actually resolve the requested set of parameters.
This looks like a perfect approach and is working perfect.
hi! I think this is a great fix, the same code exists though also in the EntityLoad
and EntityLoadByUuid
plugins, so I made a new PR: #1388 .
This plugin tries to load entity translation based on the language argument. But in case that translation doesn't exist Drupal's ContentEntityBase class throws exception
Invalid translation language ($langcode) specified.
.I suggest to add check if translation exists before trying to get it.