At the moment entity_translation expects menu arguments to be a entity load token. Ex. "%node" vs "%".
In most cases this works great, but when attempting to integrate another module as ECK that does not declare a load callback for it's variable entity types then various entity_translate callbacks will attempt to make do with the id causing unexpected results.
I propose that when an id is passed to the handler that we go ahead and load the entity via entity_load and use a new method for the translation handler $handler->getEntity(); so that we don't have this issue when '%' is used over '%LOAD_CALLBACK'.
Comments
Comment #1
grndlvl CreditAttribution: grndlvl commentedComment #2
plachLooks sensible to me, thanks.
Can we have a shorter comment, but everywhere we do this? Something like: "Ensure $entity holds an entity object and not an id."
Comment #3
plach#1: entity_translation-add_support_no_load_tokens-1866076-1.patch queued for re-testing.
Comment #5
klonos...coming from #1798646: Make ECK entities translatable (entity translation integration).
Comment #6
grndlvl CreditAttribution: grndlvl commentedRe-roll against 7.x-1.x
Comment #7
grndlvl CreditAttribution: grndlvl commentedAdding changes mentioned in #2.
Comment #8
plachLooks good to go to me. Can anyone confirm this is working with ECK?
Comment #9
mkalkbrennerYes, we use it in combination with eck
Comment #10
plachCommitted and pushed, thanks.