Using this module the text "Minimum height is ." will appear on your users profile edit page if you don't have any user picture minimum dimensions set.

The problem is in this code from the imagecache_profiles_form_user_profile_form_alter() function:

if (!empty($width)) {
    if (!empty($height)) {
      $description = t('Minimum dimensions are %dimensions.', array('%dimensions' => $width . 'x' . $height));
    }
    else {
      $description = t('Minimum width is %width.', array('%width' => $width));
    }
  }
  else {
    $description = t('Minimum height is %height.', array('%height' => $height));
  }

In plain English, the code is doing this:
- If neither height nor width is empty, print the dimensions
- If height is empty but width isn't, print the width
- If width is empty, print the height

I think the easiest solution to this problem is to add a condition immediately following the code above:

if (empty($width) && empty($height)) $description = '';

I've added that code to my own copy of the module and it works as intended.

- Ryan

Comments

rschwab’s picture

StatusFileSize
new470 bytes

1st attempt at patch

rschwab’s picture

Status:Active» Needs review

Works for me. Does it work for you?

mmachina’s picture

oh yeah! works like a charm!!!

wjaspers’s picture

Version:6.x-1.3» 6.x-1.x-dev
Status:Needs review» Needs work

Other modules that alter the form field description may lose their value.
The formatting doesn't match Drupal's standards, but looks ok otherwise.

Therefore, I'm setting this to Needs Work.
I have a patch, and will upload promptly today.

wjaspers’s picture

Status:Needs work» Needs review
StatusFileSize
new1.49 KB

Here's another patch that follows Drupal's coding conventions and checks things based on completed fields.