Relevant modules:
* taxonomy
* metatag
Step to reproduce:
1. Create content type with an autocomplete term reference field
2. Add node and type a new term in the autocomplete field for the node/add form
3. Save
What seems to happen:
The new taxonomy term is saved before the node, triggering its own field_attach_insert routine. This goes down to Entity Translation which then fires its save translation module. Metatag hooks into that with metatag_entity_translation_insert that calls entity_languge which then calls entity_translation_language. Here is where the issue is: instead of getting the handler for taxonomy_term, it gets the handler for node. Then, when it passes the taxonomy_term entity to the handler and runs entity_extract_ids(), it expects a bundle which is not set, throwing EntityMalformedException.
I've rigged this to work by getting rid of entity_translation_current_form_get_handler() on line 1641 of entity_translation.module (set $handler to false so that entity_translation_get_handler() loads the correct handler), but I'm not sure if this is the best thing to do.
Comment | File | Size | Author |
---|---|---|---|
#4 | et-incorrect_et_handler-1851118-4.patch | 1.85 KB | peximo |
#1 | et-incorrect_et_handler-1851118-1.patch | 1.82 KB | peximo |
Comments
Comment #1
peximo CreditAttribution: peximo commentedHi, I have the same problem; attached patch should fix it.
My steps to repeat:
1. Enable entity_translation
2. Enable field translation for a content type (eg: basic page)
3. Add a vocabulary, use the widget for tagging and set his terms translatable
4. Add a term reference field to the previous configured content type
5. Add new node, insert one or more tag and save
Comment #2
plachThe patch looks good, thanks! There are some issues I can fix on commit, if none provides a reroll before.
maybe > may be
I'd rename this to isWrappedEntity() to improve readability.
Extra space after "list".
Comment #3
plachWould be good to have some coverage for this too.
Comment #4
peximo CreditAttribution: peximo commentedrerolled
Comment #5
plach@impleri:
Could you confirm this fixes your issue?
Comment #6
impleri CreditAttribution: impleri commentedConfirming that #4 works for me and solves the issue.
Comment #7
plachCommitted and pushed, thanks.
Comment #8
bachbach CreditAttribution: bachbach commentedworks for me !
Comment #10
Merlineus CreditAttribution: Merlineus commentedThis patch breaks correct language detection for pathauto on node creation.
http://drupal.org/node/1925848