2 issues in one here:

Firstly any field where you select any header HTML element such as h1, h2 h3 etc. for the field and label wrapper and the field will cause the field element to drop out of the field and label wrapper:

should be:

<h1 class="views-field views-field-name"><h1 class="field-content">TEXT<h1></h1>

instead you get:

<h1 class="views-field views-field-name"> </h1>
<h1 class="field-content">TEXT<h1>

This only happens if both field and label wrapper and field use a h1-h6 element

Second issue only effects user-picture field, its seems that regardless of what HTML element you select to use for the field element it will only output a div - even if you select none you will still get a div.

ADDED:
Its seems views only looks to see if the user-picture field is set to inline in the field settings and ignores all custom HTML settings in the Style settings.

this function in views_handler_field_user_picture.inc is what is causing issue:

  function element_type($none_supported = FALSE, $default_empty = FALSE, $inline = FALSE) {
    if ($inline) {
      return 'span';
    }

    return 'div';
  }

if $inline is false it should really then look to what (if any) custom html has been selected

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lx24’s picture

Ok actually solved this issue myself. I dont know how to create a patch but basically all you need to do is change the function element_type(...) in views_handler_field_user_picture.inc to:

  function element_type($none_supported = FALSE, $default_empty = FALSE, $inline = FALSE) {
    if ($inline) {
      return 'span';
    }

    if ($none_supported) {
      if ($this->options['element_type'] === '0') {
        return '';
      }
    }
    if ($this->options['element_type']) {
      return check_plain($this->options['element_type']);
    }

    if ($default_empty) {
      return '';
    }

    if (isset($this->definition['element type'])) {
      return $this->definition['element type'];
    }

    return 'div';

  }

hope this helps

dawehner’s picture

You should definitive learn how to create patches: http://drupal.org/node/707484 It's definitive not that difficult as you think.
Sure i see the change here, but for exercise i leave this for you :)

dawehner’s picture

Priority: Major » Normal
Issue tags: -views, -user-picture, -extra div +Novice

Sometimes i'm wondering whether i do something wrong. The answer seems to be quite fast so you could have seen my answer.
It is to much to ask people to write this patches? Update priority.

Add some tag to add possible contributors

MiSc’s picture

Status: Active » Needs review
FileSize
807 bytes

Added patch for solution in comment 2.

dawehner’s picture

Status: Needs review » Fixed

Thanks for the patch, it totally look fine! Committed to 7.x-3.x and 6.x-3.x

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

Anonymous’s picture

Issue summary: View changes

Added some additional info