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.

beer-avatar-get-it--its-a-bear-and-a-deer.png

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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Devin Carlson’s picture

Status: Active » Closed (duplicate)
stupiddingo’s picture

Devin, 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.

Devin Carlson’s picture

Assigned: Unassigned » Devin Carlson
Status: Closed (duplicate) » Active
Issue tags: +Commons 7.x-3.3 radar

@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.

Devin Carlson’s picture

The 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 use theme('image_style') or some other custom theme function.

Devin Carlson’s picture

Status: Active » Needs review
FileSize
987 bytes

A 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.

Devin Carlson’s picture

User pictures also have to link to their associated user's profile page.

Zarabadoo’s picture

Status: Needs review » Needs work

There 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.

ezra-g’s picture

Component: User interface » Theme
Assigned: Devin Carlson » Zarabadoo

Reassigning.

Zarabadoo’s picture

Status: Needs work » Fixed

I reformatted Devin's code to use my suggestions and committed.

http://drupalcode.org/project/commons_groups.git/commit/535eea5

Devin Carlson’s picture

While 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:

+    '#item' => array(
+      'uri' => '$user->picture->uri',
+      'alt' => $alt,
+    ),

I committed the change with http://drupalcode.org/project/commons_groups.git/commit/c965b27.

ezra-g’s picture

Status: Fixed » Needs work

I'm getting this error, once per node:

Notice: Trying to get property of non-object in commons_groups_preprocess_node() (line 816 of /Users/ezra/Developer/htdocs/acquia/commons-builds/latest-9/profiles/commons/modules/contrib/commons_groups/commons_groups.module).

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).

ezra-g’s picture

Also, users with the default avatar show a broken image on nodes they create.

Devin Carlson’s picture

rosemeria’s picture

FileSize
100.63 KB

#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.
partial form

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

Anonymous’s picture

Issue summary: View changes

Thought I'd use grammar this time.