I just upgraded to Views 6.x-2.6 from Views 6.x-2.5, and in the views-view-fields.tpl.php file, $field->inline_html is appropriately being set to 's for my inline fields, but the $field->element_type is being set to a

- which results in a div tag within a span tag - invalid and causing line breaks in inappropriate places.

As a quick fix for this, I've replaced $field->element_type with $field->inline_html in all the places it appears. However - my guess is the change is further upstream whereever the element_type value is being set.

CommentFileSizeAuthor
#6 views_494490_6.patch726 bytesnhck

Comments

jastraat’s picture

My comment above sadly interpreted some of my text as HTML tags. To clarify,
"$field->inline_html is appropriately being set to 'span' tags for my inline fields, but the $field->element_type is being set to a 'div' tag which results in a div tag within a span tag"

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

Which fields are in use matter here, as the field handler is ultimately responsible for making the decision as to whether or not the output is inline or block. If the fields that are doing this are not core Drupal fields, then you need to file this against the module providing those fields.

jastraat’s picture

It's happening in unformatted views with the 'fields' row style. I've observed the problem specifically affecting node reference fields, so I'll take a look at the new changes in the cck module.

jastraat’s picture

So - this is specific to multi-value fields. CCK made a change in May to fix invalid XHTML related to this issue:
http://drupal.org/node/369364

Unfortunately, that just moves the problem. Now, if two fields are displaying 'inline' in a view but one of them is potentially multi-value, there's still a div within a span. The div is generated by CCK, and the span is generated by views. I've posted an issue for CCK here: http://drupal.org/node/494704

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No update for more than 30 days.

nhck’s picture

StatusFileSize
new726 bytes

I followed the discussion at #369364: field with multiple values, not marking itself properly as block level element for views integration? and realized that h views/modules/user/views_handler_field_user_picture.inc needs to be patched to return a correct element type, because

views_handler_field_user_picture::render() will return theme('user_picture', $account) - which is a block level element (div). So wrapping it inside a span is incorrect, but the parent class function views_handler_field::element_type() returns 'span' by default.

nhck’s picture

Status: Closed (fixed) » Needs review
merlinofchaos’s picture

Status: Needs review » Fixed

I agree, that element type was wrong. Committed to all branches. Thanks.

Status: Fixed » Closed (fixed)

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

oksid’s picture

What about to set default elemnt to div and when neede seting the display property in css to inline ?