Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The partial node form displays an avatar image style different than the views beneath. The views use a thumbnail style, while the partial node form displays a 50x50_avatar style.
Personally, I like the square 50x50_avatar better for both cases, and this matches the mockups. Figure this isn't my call to make though and before I go and write patches for six views spread across five modules, it would be good to know that is the direction y'all want to go.
/brent
Comments
Comment #1
Devin Carlson CreditAttribution: Devin Carlson commentedThis is a duplicate of #2016811: NotifyMessages - ActivityStream unclear user picture.
Comment #2
stupiddingo CreditAttribution: stupiddingo commentedDevin, I'm not so sure this is a duplicate, unless you're just rolling up a couple mildly related issues. The problem described in this issue is that the avatar in the partial node form is a different image style than the commons_bw_* views they are attached. The issue you linked to is in regards to message activity streams in the sidebar.
What needs changed is either the imagestyle used in the commons_bw views or the imagestyle used in the partial node form. I'd be happy to work on a patch if we have a decision on whether the 50x50 or thumbnail style is appropriate.
Comment #3
Devin Carlson CreditAttribution: Devin Carlson commented@stupiddingo Thanks for the heads up. :) I had some changes applied locally that made this looks like a duplicate.
I'll see if I can address this as part of the Commons 7.x-3.3 radar issues.
Comment #4
Devin Carlson CreditAttribution: Devin Carlson commentedThe front page view (
commons_bw_all
) displays an unformatted list of nodes using the teaser view mode. The issue is that node.module uses the same theme function (user_picture) to format user pictures for display in the "submitted by" meta information as user.module does for displaying the user picture on the user profile page.It's possible to specify the image style used by theme('user_picture') by modifying the "user_picture_style" variable but, as mentioned above, this will change the size of user pictures in all locations.
It looks like the best solution would be to either modify the
commons_bw_all
view to display a list of fields or to override node.module's$variables['user_picture']
to usetheme('image_style')
or some other custom theme function.Comment #5
Devin Carlson CreditAttribution: Devin Carlson commentedA patch to alter $variables['user_picture'] to display the user picture with the 50x50 image style applied.
The patch is against commons_groups.module to ensure that the style is available. The image is wrapped in a div with the class "user-picture" to maintain the same markup that was previously generated (to prevent any styling issues with Commons Origins). The extra markup can be removed/moved into a theme wrapper as required/desired.
Comment #6
Devin Carlson CreditAttribution: Devin Carlson commentedUser pictures also have to link to their associated user's profile page.
Comment #7
Zarabadoo CreditAttribution: Zarabadoo commentedThere are 2 things I would like to see changed in this.
There is no link back to the profile
Something that is missing with this is the link wrapper around the profile image like what template_preprprocess_user_picture() adds. It is better to mimic that as closely as possible. I woudl also recommend using theme_image_formatter() instead of image_style() as that can handle the link wrapper.
For bonus points you could give this a more specific theme option with the double underscore pattern. (ie, image_formatter__node_teaser). That would preferably be added at a larger scale, though and not towards this one instance.
Do not use prefix and suffix
In addition, use
'#theme_wrappers' => array('container')
with an #attributes array instead of #prefix and #suffix.Core gripe that we can't do anything about
This actually shouldn't be added in preprocess and should be renderable array and not a complete string. That is something that is beyond the scope of this issue, but commons in general.
Comment #8
ezra-g CreditAttribution: ezra-g commentedReassigning.
Comment #9
Zarabadoo CreditAttribution: Zarabadoo commentedI reformatted Devin's code to use my suggestions and committed.
http://drupalcode.org/project/commons_groups.git/commit/535eea5
Comment #10
Devin Carlson CreditAttribution: Devin Carlson commentedWhile testing #2030087: Unable to focus on node body field on iPad I did a fresh install of Commons and noticed that avatars weren't displaying.
The commit in #9 accidentally wraps the #item URI in quotes:
I committed the change with http://drupalcode.org/project/commons_groups.git/commit/c965b27.
Comment #11
ezra-g CreditAttribution: ezra-g commentedI'm getting this error, once per node:
It appears that this happens when $account->picture is NULL. However, we should support the same themeing pipeline for the default user avatar when one hasn't been set.
In general, we should be using the $account variable to avoid accidental changes to the global $user object, which can lead to security issues (eg, changing the currently logged in user).
Comment #12
ezra-g CreditAttribution: ezra-g commentedAlso, users with the default avatar show a broken image on nodes they create.
Comment #13
Devin Carlson CreditAttribution: Devin Carlson commentedThis should be fixed with http://drupalcode.org/project/commons_groups.git/commit/4c854ef and http://drupalcode.org/project/commons_groups.git/commit/077d52f.
Comment #14
rosemeria CreditAttribution: rosemeria commented#13 - fix works - thanks Devin
I'm am not sure why we need the user picture on the partial form - I don't need to see a picture of myself?? Without the user picture provides more room to write, form looks better, less like a content node and makes for less clutter.
Comment #15.0
(not verified) CreditAttribution: commentedThought I'd use grammar this time.