Closed (fixed)
Project:
Translation Management Tool
Version:
7.x-1.x-dev
Component:
Core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 Feb 2012 at 02:34 UTC
Updated:
7 Jan 2013 at 15:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
berdirThe question is what kind of hooks we need.
State changes are relatively easy to detect using the default insert/update hooks. I'm not sure if we need specific hooks for that. Another story would be a hook *before* a state change is done which could be implemented to prevent such a change. I've thought about this before, but I have no idea how to that in a generic way. I have a feeling that we will need more specific hooks like those that I added to the ui checkout function.
Comment #2
swentel commentedA hook on
tmgmt_field_populate_entitywould be useful. There's no way (besides extending TMGMTNodeSourcePluginController to take over the saveTranslation() method and adding additional custom calls) to act on saving field api fields. I have a really special use case where the value of the column is a reference to a panel display.hook_tmgmt_source_translation_structureis good because I could implement it for my field type, but I need something likehook_tmgmt_field_import(or whatever you want to call it).Unless I'm missing something completely.
Comment #3
swentel commentedHere's a patch which allows me to modify the entity when a module who owns the field type implements a hook/function. Or use use the module name of course, doesn't really matter.
Comment #4
berdirYes, this looks useful.
#1863600: Untranslated safe_value causes wrong pathauto to be assigned to translated node is a nice example why the text field also needs to do some post-processing of those values, can we additionally add an alter callback that's invoked for the field module? Or should it be a normal drupal_alter() or is there maybe even something that we can call? (I don't think calling hook_field_load() makes sense?)
Comment #5
berdirWondering if we want to unify, as far as it makes sense, the arguments for this hook with the new arguments to the structure hook/callback. Which means "$entity_type, $entity, $field, $instance, $langcode, $items". Instead of items, it would be $data.
Comment #6
berdirSomething like this.
Comment #7
berdirForgot a file.
Comment #8
berdirOk, commited.
I'll mark this issue as fixed. We'll open more specific issues if the need for other hooks occur.