My profile picture is appearing correctly in the 'Recent Activity' list and in the menu bar, but not in any comments listed below Task content---here it is just showing the default OA placeholder.

Comments

adamtyoung’s picture

Component: Code » User interface
hosais’s picture

I have the same result. In comments, the profile photo is not correct. Instead, it show the default oa user default image.

I traced a little code,
In profiles\openatrium\modules\contrib\oa_core\modules\oa_users\oa_users.module
Line 95:

function oa_users_oa_users_picture($account = NULL, $image_style = 'oa_small_thumbnail', $url = FALSE) {
  if (isset($account) && !empty($account->field_user_picture)) {
     ...
  }else {
      go to put default oa image.
  }

Since field_user_picture does not exist so it is always false. => default oa image. I think oa_comment_preprocess_comment(&$vars) does not have expected user information.

Anyone knows how to fix it?

Thanks.

mpotter’s picture

Actually, the problem was in the new template for comments. It was always showing the picture for the task itself and not for the comment. Leaving this open because it's working for me now but not sure if there is still an issue for the default user. The field_user_picture *should* exist on your OA site.

mpotter’s picture

Status: Active » Needs review

The fix was in commit ef53468 to oa_comment, so marking this for Review if someone wants to pull that commit and test it.

dpoletto’s picture

FYI I add that the same behaviour seems to happen also on a Discussion Section where, on its main view ("View: Open Atrium Comment Topic List: Topics"), each Discussion Post is correctly shown with the poster user profile's picture but (new/old) comments, relevant to that one, are shown with the default OA place holder of each user's profile picture.

The commit provided (http://cgit.drupalcode.org/oa_comment/commit/?id=ef53468992a2857af6ed94a...) fixes that (I'm on OA 2.41 updated from OA 2.33). Thanks.

mpotter’s picture

Status: Needs review » Fixed

Yep, I mentioned in #3...it applies to all comments on any content type.

Glad to hear the commit fixed it for you. Marking this as fixed.

hosais’s picture

Thank you. I tested and it works for me too.

Status: Fixed » Closed (fixed)

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