- Issue created by @dahousecat
- π¬π§United Kingdom dahousecat
Huh, actually the exception was thrown via trackUpdateOnEdition, not trackUpdateOnDeletion.
Updated patch to try catch that method too. - π¬π§United Kingdom alexpott πͺπΊπ
Nice find... the problem here is that \Drupal\entity_usage\Plugin\EntityUsage\Track\Link::getTargetEntities should not throw the exception. We should put the. try catch in there. Also I don't think we should be logging here either. I think we should just return an empty array and move on. That means other fields with entities will still be tracked for this entity.
- π¬π§United Kingdom alexpott πͺπΊπ
Or perhaps even better would be to put the try catch inside field loop in \Drupal\entity_usage\EntityUsageTrackBase::trackOnEntityUpdate() and \Drupal\entity_usage\EntityUsageTrackBase::trackOnEntityCreation()... it's tricky - that'd be more robust but potentially more likely to catch something you would want to log - so if we do that we should log as well.
- Merge request !112Resolve #3503961 "Trackupdateondeletion throws exception" β (Merged) created by alexpott
- π¬π§United Kingdom alexpott πͺπΊπ
Could do with adding an automated test here.
- π¬π§United Kingdom alexpott πͺπΊπ
I think this is ready now. We log any exceptions thrown by track and have test coverage that the exceptions are logged.
- First commit to issue fork.
-
marcoscano β
committed 07472c03 on 8.x-2.x authored by
alexpott β
Issue #3503961 by alexpott, dahousecat, marcoscano: Entity tracking can...
-
marcoscano β
committed 07472c03 on 8.x-2.x authored by
alexpott β
- πͺπΈSpain marcoscano Barcelona, Spain
Thanks for jumping in and for the generic solution in the base class π
Automatically closed - issue fixed for 2 weeks with no activity.