Closed (fixed)
Project:
Entity Embed
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 May 2014 at 17:11 UTC
Updated:
3 Jun 2014 at 21:30 UTC
Jump to comment: Most recent
Problem/Motivation:
Right now if such an entity_type is specified which does not exists, in case of 'load_by_id' it produces a Drupal error and in case of 'load_by_uuid' it results in WSOD.
Proposed Solution:
Do a check whether the specified entity_type exists before trying to load the entity. In case that entity_type is not found, do not apply the filter and leave the placeholder text intact. (Similar behavior when image load fails - alt text, in our case. The placeholder text that may have been inserted inside the entity div).
Comments
Comment #1
dave reidSound good. I think it should just be easy as wrapping it as a try-catch statement around the entity loading and rendering.
Comment #2
cs_shadow commentedPull Request for this issue: https://github.com/drupal-media/entity_embed/pull/10
Comment #3
cs_shadow commentedHere, I've used if-else if that's fine. It'll be less expensive than try-catch IMO. Error will be detected quite early in this case. Let me know if we need to change this to try-catch because I'm not sure what's more appropriate in this case.
Comment #4
dave reidI think it would better to use try/catch since there could be other errors when loading or rendering the entity. It feels more proper developer-wise as well.
Comment #5
cs_shadow commentedNew PR: https://github.com/drupal-media/entity_embed/pull/12
Previous one was messed up, so created a new one.
Comment #6
slashrsm commented