This is the start of the HTML output of the entity collection:

<div class="entity entity-field-collection-item field-collection-item-field-amounts clearfix" class="entity entity-field-collection-item field-collection-item-field-amounts">
  <div class="content">

The first div element contains 2 class selectors.

The output is generated from the file-collection-item.tpl.php file, from this line:
<div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>

I am not sure if it's just necessary to remove one of the $attributes or $classes variable from being printed at that level or perhaps the logic of how the $attributes / $classes variable is generated should be altered in the module?

CommentFileSizeAuthor
#4 fix_double_classes-1836250-4.patch445 bytesjoseph.olstad

Comments

kscheirer’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Priority: Normal » Minor

Moving to minor in the hopes of getting a 1.0 release out, double classes are definitely a mistake but don't seem to harm anything in the mean time.

gdaw’s picture

Issue summary: View changes
Issue tags: +Resolve W3C Validation Error, +accesibility

This is still an issue, it causes w3c validation errors and therefore fails wcag accessibility requirements.

class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>

Classes are being manually added by print $classes; , "clearfix" being appended and then print $attributes; is adding the same classes.

I would suggest keeping only print attributes and adding clearfix to the attributes class array.

We have tested this solution and it seems to be working fine.

gdaw’s picture

Priority: Minor » Major
joseph.olstad’s picture

StatusFileSize
new445 bytes

patch for double classes (w3c validation fix)

gdaw’s picture

Tested this fix in comment#4 , it solves our w3c validation issue.

gdaw’s picture

Status: Active » Reviewed & tested by the community
gdaw’s picture

Priority: Major » Minor
Status: Reviewed & tested by the community » Closed (works as designed)

**comment from joseph.olstad**

After more testing we determined that the double class may be actually be injected by our theme.

We put the theme to garland and set it as default and the double class went away.

We'll re-open this if it comes up again. We're not satisfied with our workaround, we shouldn't have to upstream this.

gdaw’s picture

mgifford’s picture

Issue tags: -accesibility +Accessibility
avpaderno’s picture

Issue tags: -W3::C validation +W3C validation

I am merging two issue tags. I apologize for bumping a closed issue.