Closed (fixed)
Project:
Entity Dependency API
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2012 at 00:08 UTC
Updated:
25 Sep 2014 at 11:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Sergii commentedI believe you should check $entity variable before passing to entity_extract_ids().
Comment #2
Sergii commentedComment #3
danielb commentedWhile mucking around with this module I also encountered this exception, (due to a bug I caused) where it was trying to load an entity that didn't exist.
Sergii's patch did the trick to avoid the exception and skip the failed entity.
Comment #4
ianthomas_ukSurely the problem here is that entity_load() isn't returning the entity? Yes, this patch will stop the fatal error, but the entity won't be deployed, which could be even worse.
Ideally we should fix the entity_load() call, but at the very least it should log that an entity failed.
Comment #5
ianthomas_ukCoincidentally after adding my last comment I ran into the bug myself and have produced this alternative patch. I realised that entity_load wasn't returning an entity because my parent node was corrupt, which isn't really something we can do much about.
Instead of ignoring the missing entity when trying to use it, I stop the entity from even being added to the iterator in the first place, and log a watchdog_warning. This means it fixes the problem in both EntityDependencyIterator::hasChildren(), like the patch on #1, and DeployIterator::current() from the deploy module.
It would be great to get this in and release a new alpha of entity_dependency, as currently the deploy module only works with 7.x-1.x-dev.
Comment #6
jakeschlachter commentedFound this thread after running into the same error, attempting to use Deploy and Features to set up taxonomy terms. Thank you for the patch. It worked for me.
Comment #7
dixon_This patch needs re-rolling after commit
4139d7cb34304e7d1515b5dc1d4a0ab5fe15808dwent in.Comment #9
dixon_Committed the re-rolled patch to 7.x-2.x! Thanks a lot @ianthomas_uk and @Sergii for working on this!