Image avatars should be seen as entity dependency as it is an entity attached to the user entity. This is a feature request but with a very high priority as this is a very much used attribute of the account entity.
I am currently checking why this is not working. The part to push this to a deploy plan already works by following hook.
/**
* Implements hook_entity_dependenies().
*/
function user_entity_dependencies($entity, $entity_type) {
if ($entity_type == 'user') {
$dependencies = array();
// The user has a 'file' dependency through the picture property.
$dependencies[] = array('type' => 'file', 'id' => $entity->picture->fid);
// You could try it the normal way, however the utility function would need to change as well.
//$entity->picture = $entity->picture->fid;
//entity_dependency_add($dependencies, $entity, 'file', array('picture'));
return $dependencies;
}
}
The patch will arrive later on, however I could use a couple of pointers to help me figure out how to add the knowledge of the file dependency to the deploy action itself.
Comments
Comment #1
Stalski commentedHere is the patch
Comment #3
Stalski commentedPrevious patch did not make sure avatars are actually used on the site and the picture is set.
This patch fixes that problem.
Comment #4
Stalski commentedComment #5
dixon_I like simple patches with high value :)
Committed, thanks!