Hi,

I have been struggling to get my installation of Ubercart to validate to XHTML 1.0. Two pages cause the problems. These are mysite.com/catalog and mysite.com/cart. I have now managed to solve the problem by changing code in the modules. The changes, and errors, are documented below.

mysite.com/cart

Validation Error: Attribute "alt" exists, but can not be used for this element.
Offending code in uc_cart.module:

Line 577: $output .= '<span class="cart-block-title-bar" alt="'. t('Show/hide shopping cart contents.').'" title="'. t('Show/hide shopping cart contents.') .'">'. $title .'<span class="cart-block-arrow"></span></span>';

Solution:

Line 577: $output .= '<span class="cart-block-title-bar" title="'. t('Show/hide shopping cart contents.') .'">'. $title .'<span class="cart-block-arrow"></span></span>';

Validation Error: Attribute "width" exists, but can not be used for this element.
Offending code in uc_cart.module

Line 1048: $table[$i]['desc']['#cell_attributes'] = array('width' => '100%', 'class' => 'desc');

Solution:

Line 1048: $table[$i]['desc']['#cell_attributes'] = array('class' => 'desc');

Validation Error: Attribute "nowrap" exists, but can not be used for this element.
Offending code in uc_cart.module

Line 1050: $table[$i]['total']['#cell_attributes'] = array('nowrap' => 'nowrap', 'class' => 'price');

Solution:

Line 1050: $table[$i]['total']['#cell_attributes'] = array('class' => 'price');

Validation Error: Attribute "nowrap" exists, but can not be used for this element.
Offending code in uc_cart.module

Line 1064: 'nowrap' => 'nowrap',

Solution:

Line 1064: /* removed */

mysite.com/catalog

Validation Error: Attribute "width" exists, but can not be used for this element.
Offending code in uc_product.module

Line 1258: '#cell_attributes' => array('width' => '100%'),

Solution:

Line 1258: /* removed */

Validation Error: Attribute "nowrap" exists, but can not be used for this element.
Offending code in uc_product.module

Line 1216: 'cell' => array('data' => t('Add to cart'), 'nowrap' => 'nowrap'), 

Solution:

Line 1216: 'cell' => array('data' => t('Add to cart')),

After making changes above, all pages appear to validate to XHTML 1.0. Still checking so others may crop up.

Nick

Comments

andreiashu’s picture

Hi Nick,

Would it be possible for a patch ?
Thanks !

nickbits’s picture

Hi,

Can you recommend a good Windows tool for creating a patch?

Nick

tr’s picture

rszrama’s picture

In cases where nowrap attributes are removed, can we also see some recommended CSS showing the appropriate white-space: nowrap;?

andreiashu’s picture

rszrama’s picture

I know how it works. ; ) I just wanted to make sure if any nowrap attributes are removed from HTML that any patch includes the appropriate CSS so that the display of these elements isn't affected.

nickbits’s picture

StatusFileSize
new798 bytes
new1.72 KB

Hi,

Have used UnixUtils to generate patch files. It's been a while since I generated patch files, forgot how easy it is!

Anyway, the two patches are attached. I have only removed or altered entries to ensure the XHTML code is valid. I have not yet looked at the CSS.

Nick

mikejoconnor’s picture

Status: Active » Needs review
Island Usurper’s picture

Status: Needs review » Needs work

OK, let's get some CSS to reconstruct the intended styles those attributes provided.

tr’s picture

Does this patch eliminate *all* the validation errors on your site? As long as you're addressing the issue, it would be nice to do a complete job of it.

nickbits’s picture

@TR, at present YES. I have not found any other XHTML errors. I am still going through and double checking things, but at present nothing has turned up. It would be nice if others could also check this to ensure that it is a bug and not me just me!!!

rszrama’s picture

Issue tags: +ubercamp sprint
Island Usurper’s picture

Status: Needs work » Fixed
StatusFileSize
new2.03 KB

If there aren't any other validation errors, then I guess I can just commit this patch. It combines the two files in #7 and adds the CSS needed to keep the same styles.

Status: Fixed » Closed (fixed)
Issue tags: -ubercamp sprint

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