In the standard profile install the function user_install_picture_field() creates the field programatically. This prevents configuration import across two standard profile installations.

Solution

Add default configuration for user_picture field.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott’s picture

Status: Active » Needs review
FileSize
8.46 KB
damiankloip’s picture

+++ b/core/modules/user/tests/modules/user_picture_field/config/field.field.user.user_picture.yml
@@ -0,0 +1,31 @@
+id: user.user_picture

+++ b/core/modules/user/tests/modules/user_picture_field/config/field.instance.user.user.user_picture.yml
@@ -0,0 +1,24 @@
+id: user.user.user_picture

Is there a reason this lives in it's own module rather than just the standard profile config dir?

alexpott’s picture

FileSize
8.2 KB
9.31 KB

@damiankloip that was for testing purposes but as @xjm pointed out this was not actually testing the standard profile anymore and the config in the test module could diverge.

This patch changes the tests to use standard profile thereby testing it.

Also more of the config can be provided as defaults.

larowlan’s picture

Closed #2114887: Maximum nesting level when attaching comment field to User. as a duplicate of this.
Basically if you add a comment field to the user entity, and don't call user_install_picture_field(), because you don't have a compact entity display for users, the call to user_view($account, 'compact'); in template_preprocess_comment creates an infinite loop as the compact view mode attempts to render the comment thread, which attempts to render the comment, which attempts to render the user - and so on.

alexpott’s picture

Issue summary: View changes
FileSize
630 bytes
9.65 KB

#1443606: Alt, title, width and height for default images has landed requiring a change to this.

alexpott’s picture

Re #4 I don't think this is going to fix that issue. Comment somehow needs to take care of that itself. It should not be assuming that compact exists whilst the compact configuration is in the standard profile. I'm going to re-open the other issue.

alexpott’s picture

5: 2124619.5.patch queued for re-testing.

damiankloip’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/core/profiles/standard/config/entity.display.user.user.compact.yml
@@ -0,0 +1,16 @@
+    weight: 0
...
+    visible: false
+status: true

+++ b/core/profiles/standard/config/entity.form_display.user.user.default.yml
@@ -0,0 +1,13 @@
+    weight: -1

+++ b/core/profiles/standard/config/field.instance.user.user.user_picture.yml
@@ -0,0 +1,29 @@
+required: false
+default_value: {  }

Nice! Actual data types.

This patch looks good to me now. Everything is living in it's correct home.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Easy-peasy.

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.