Apparently if you take the "minimal" installation, it does not create the user picture field. I tried to manually create it, but now the Simple Facebook Connect module is not synching profile images, because it can't find the default user_picture field.
This is what the facebook module does:
// Try to download the profile picture and add it to user fields.
if (user_picture_enabled() && $picture_url) {
if ($file = $this->downloadProfilePic($picture_url, $fbid)) {
$fields['user_picture'] = $file->id();
}
}
$new_user = User::create($fields);
$new_user->save();
I can confirm that it is able to get the $file, but the problem has something to do with the fields.
How do I correct recreate the "user_picture" field?
This is returning false:
function user_picture_enabled() {
$field_definitions = \Drupal::entityManager()->getFieldDefinitions('user', 'user');
return isset($field_definitions['user_picture']);
}
How do I add this field definition again?
I looked in the minimal.install file. I was hoping to find the code that enables user_picture, but all I could find was:
\Drupal::configFactory()->getEditable('system.theme.global')->set('features.node_user_picture', FALSE)->save(TRUE);
There is nothing in standard.install. I tried running the following, without any luck.
\Drupal::configFactory()->getEditable('system.theme.global')->set('features.node_user_picture', TRUE)->save(TRUE);
How do I get my user_picture field back without adding it manually, since I would end up with field_user_picture?