Comments

davidseth’s picture

StatusFileSize
new2.54 KB
new1.58 KB

Brought over from: http://drupal.org/node/1838702#comment-7013856

Need to put in avatar images into commons profile images directory. The naming scheme is 'avatar{n}.jpg'. Need 5 images for the 5 created users in the install routine (I have also attached one avatar to get started). So avatar1.jpg, avatar2.jpg, etc...

ezra-g’s picture

Assigned: Unassigned » ezra-g
ezra-g’s picture

Status: Active » Needs work
StatusFileSize
new19.96 KB

I tested this patch with example avatars but the install failed with

Undefined variable: image_path in commons_add_user_avatar()

.

I updated the variable name, provided avatars from Acquia's design team and introduced a '-' into the file name pattern. However, the avatars don't seem to be getting saved to the user accounts.

Here's an in-progress patch.

ezra-g’s picture

Status: Needs work » Fixed

I tweaked the filepath for the images, tested on a fresh install and committed.

Thanks, davidseth!

http://drupalcode.org/project/commons.git/commit/d362d27

ezra-g’s picture

Status: Fixed » Needs work

I get these file system errors after default content is created - We should either fix this or document any needed permission changes:

Warning: unlink(/Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/profiles/commons/images/avatars/avatar-2.png): Permission denied in drupal_unlink() (line 2202 of /Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/includes/file.inc).
Warning: unlink(/Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/profiles/commons/images/avatars/avatar-3.png): Permission denied in drupal_unlink() (line 2202 of /Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/includes/file.inc).
Warning: unlink(/Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/profiles/commons/images/avatars/avatar-4.png): Permission denied in drupal_unlink() (line 2202 of /Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/includes/file.inc).
Warning: unlink(/Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/profiles/commons/images/avatars/avatar-5.png): Permission denied in drupal_unlink() (line 2202 of /Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/includes/file.inc).
Warning: unlink(/Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/profiles/commons/images/avatars/avatar-6.png): Permission denied in drupal_unlink() (line 2202 of /Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/includes/file.inc).
Warning: unlink(/Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/profiles/commons/images/avatars/avatar-7.png): Permission denied in drupal_unlink() (line 2202 of /Users/ezra/Developer/htdocs/dev/acquia/commons_nightly/commons/latest/includes/file.inc).

japerry’s picture

Assigned: ezra-g » japerry
japerry’s picture

Also am seeing these issues upon completion of the install (when you get to the homepage right after)

Notice: Object of class stdClass could not be converted to int in commons_origins_preprocess_node() (line 146 of /Users/japerry/Sites/commons/repos/themes/commons_origins/template.php).
Notice: Object of class stdClass could not be converted to int in commons_origins_preprocess_node() (line 146 of /Users/japerry/Sites/commons/repos/themes/commons_origins/template.php).
Notice: Object of class stdClass could not be converted to int in commons_origins_preprocess_node() (line 146 of /Users/japerry/Sites/commons/repos/themes/commons_origins/template.php).

keithleeds’s picture

Getting the same error...

Looks like what was wanted was something like:

  if (empty($vars['elements']['#node']->picture )) {
    $vars['classes_array'][] = 'no-user-picture';
  }

.../template.php line 146:
-  if ($vars['elements']['#node']->picture == 0) {
+  if (empty($vars['elements']['#node']->picture )) {
davidseth’s picture

Status: Needs work » Reviewed & tested by the community

@keithleeds, tested your change (latest code) and working fine on new install. Avatars show up and no errors.

Thanks.

ezra-g’s picture

Status: Reviewed & tested by the community » Fixed
webchick’s picture

What?! No Ezra! Critical bug! :D

Status: Fixed » Closed (fixed)

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