Thanks Monica,
I have phpmyadmin open with the ca_object_representation table opened, sorted to have the latest entry on top.
I have the desired value set as default in list_items.
What I can see happening when I add an image in the object editor is a new record being created with source_id as NULL.
If I open the representation editor the desired value is prepopulated in source_id. If I press save here the value in the table is changed to the desired value.
So it appears the ca_objects_representations bundle in the object crates the new record after save in the object editor but does not set the default value for source_id.
I guess it would be hard/impossible to add source_id to the editable representation fields for the ca_objects_representations or would you know a way?
How would I set the trigger on save of ca_object as you suggest?
For the moment in prepopulate.conf I have:
enabled = 1
prepopulate_fields_on_save = 1
prepopulate_fields_on_edit = 1
prepopulate_rules = {
source_id_rule = {
table = ca_object_representations,
mode = addIfEmpty,
useFor = [edit, save],
target = ca_object_representations.source_id,
template = 444,
},
}