Needs work
Project:
Entity reference
Version:
7.x-1.6
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2023 at 16:07 UTC
Updated:
10 Feb 2023 at 23:00 UTC
Jump to comment: Most recent
Trying to view an entity reference field throws a fatal error if the referenced target entity is disabled.
This error happens with any entity type. For example, with comment:
test. test, for example field_comment_ref. Set the target type to comment. Use a Select list as the widget test. Type anything in the title. For the comment reference field, choose any of the listed comments in the select listtestThen...
test you added aboveI believe the solution may be to check if the entity type exists by checking entity_get_info() in entityreference_field_formatter_prepare_view() before calling entity_load().
Comments
Comment #2
joseph.olstadUpgrade to this
https://www.drupal.org/project/entityreference/releases/7.x-1.6-rc3
Comment #3
joseph.olstadReleased 1.6 to save you the trouble.
https://www.drupal.org/project/entityreference/releases/7.x-1.6
Comment #4
joseph.olstadActually, looks like a new issue, if you propose a patch I'll review.
See release notes for ideas.
https://www.drupal.org/project/entityreference/releases/7.x-1.6
Comment #5
joseph.olstadputting this to minor, should be an infrequently observed issue, with that said, could definately be improved. I will review patches.