Score:0

How to get "user pictures in posts" to not be greyed out/ disabled?

eu flag

Setup: Drupal 9 with Claro admin theme and Olivero default theme.

Scenario: When I navigate to admin>appearance>settings>global settings, under the first section "page element display", the first two options ("user pictures in posts" and "user pictures in comments") are both selected but greyed out and unable to change. The second two options below are both selected as well but aren't greyed out, and I'm able to freely switch between enabled and disabled. When I switch from global settings to Claro's settings, "page element display" is identical. However, when I switch to Olivero's settings, only "user pictures in comments" is enabled out of the four options. And again, the first two user picture settings are greyed out and unable to change, but the second two options are able to freely.

Question: How can I get "user pictures in posts" to not be grey/ disabled, so that I can enable this? I need my site to have profile/account pictures, which should display by the user's posts/ user's content (and their account if possible).

What I've tried:

  • I've searched for modules (I did find a couple that might work but they were both unsecure, not maintained, and didn't even have the "composer require (...)" link with additional info typically found at the bottom of modules)
  • Searched on Drupal answers (and google, reddit, quora) for a solution but no one else seems to be having this problem?
  • Testing that "user pictures in comments" would work at least, and they do which tells me that being able to select "user pictures in posts" should work for me as well if I were able to select it
  • "routine" troubleshooting- checked logs (nothing), cleared caches, updated composer, ran cron, updated db, as well as installing completely new and standard Drupal 9 with no added themes or modules (with same problem), so if this can't be reproduced or if no one else has the same issue, I have no idea what I'm doing differently or is unique about my installation. (Am running Drupal on Cloudways hosting, and did a regular installation as a test on there with same server and setup, as well as a test installation on my local environment using docker/ ddev. All 3 have this issue)

(I would really like to keep using the Olivero theme and not have to switch themes in order to get user account pictures. All help is greatly appreciated)

Score:0
id flag

A look through of the code shows that these will be disabled if there is not a field on user entities named user_picture.

zack cv avatar
eu flag
thank you for the reply, I added this field but the option is still grey/ disabled. The machine name is field_user_picture, I'm not sure if the "field" is messing it up, but this part of it is unchangeable. Also the image isn't displayed on content, but is in the user's account but without the expected (or any) formatting. It is the standard Drupal large image, and isn't beside the username (like in comments). Position wise, the best I can do is move it to below the username on the manage display page. Any additional advice would be extremely helpful.
id flag
The field must be called `user_picture` according to what I see in the codebase, and the field should be seen at /admin/config/people/accounts/fields.
id flag
I have verified by creating and removing the `user_picture` field that my answer is correct.
zack cv avatar
eu flag
just to verify, you are adding the "image" field and it is being displayed correctly, not in the format I described above? If so, I still don't understand how Drupal could be rendering two different things for us, and my setting remains grey. Thank you again for the continued help.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.