- last update
over 1 year ago 30,338 pass - 🇮🇳India venkatadapa
Attached a patch to fix this issue. If the target_id is empty (i.e integer zero) it is irrelevant to show this error message.
- last update
over 1 year ago 30,338 pass - Status changed to Needs work
over 1 year ago 5:19am 11 June 2023 - 🇺🇸United States smustgrave
As a bug can we add a test assertion to show the issue.
Thanks!
- 🇺🇸United States mikelutz Michigan, USA
Moving this issue to the image system since this is not directly related to migrations. Having a zero or null id here is a problem, since it means you are saving an image field with an invalid or missing target id, and this shouldn't happen. We definitely don't want to surpress the error in this case. For you, this likely means there is an error in your migration, causing the field to be created with an empty value instead of being skipped and having no value. Someone with in the #migration slack channel may be able to help you with that.
Regardless, triggering this line with an invalid id can happen if a referred file is deleted. Getting this error with an id of 0 or null means there is a bigger problem happening somewhere. If this was happening in the normal drupal UI, it would mean a big big elsewhere that needs to be fixed, rather than changing the error message, but migrations are very powerful and can let you get into situations like this if not configured correctly, and if that's the case, there may be no need to adjust the error here, as it would be impossible to trigger in the UI due to other checks in the entity form system.