Project:Ubercart
Version:6.x-2.0-rc3
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed (fixed)
Issue tags:ubercamp sprint

Issue Summary

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

#1

Hi Nick,

Would it be possible for a patch ?
Thanks !

#2

Hi,

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

Nick

#3

#4

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

#5

#6

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.

#7

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

AttachmentSizeStatusTest resultOperations
uc_cart.patch1.72 KBIgnored: Check issue status.NoneNone
uc_product.patch798 bytesIgnored: Check issue status.NoneNone

#8

Status:active» needs review

#9

Status:needs review» needs work

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

#10

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.

#11

@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!!!

#12

#13

Status:needs work» fixed

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.

AttachmentSizeStatusTest resultOperations
492928_xhtml.patch2.03 KBIgnored: Check issue status.NoneNone

#14

Status:fixed» closed (fixed)

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

nobody click here