This issue has also been addressed here: #492928: XHTML Validation

However, the code in the patch (which I believe has been included in the update I just installed) does not solve the problem.

With the latest version of Ubercart, the catalog gets these errors on validation:

   1.   Error  Line 141, Column 243: Attribute "nowrap" exists, but can not be used for this element.
      …s="active">Price</a></th><th nowrap="nowrap">Add to cart</th> </tr></thead>
   2. Error Line 143, Column 271: Attribute "width" exists, but can not be used for this element.
      …" height="100" /></a></td><td width="100%"><a href="/store/bang-fleur-shirt">
   3. Error Line 143, Column 348: Attribute "nowrap" exists, but can not be used for this element.
     …Bang Fleur Shirt</a></td><td nowrap="nowrap"><span class="uc-price-product uc

Further, "nowrap" is used throughout the code, as shown by this grep:

$ grep -r "nowrap' =>" .
./uc_product/uc_product.admin.inc:        array('data' => uc_product_feature_data($feature->fid, 'title'), 'nowrap' => 'nowrap'),                                                                                             
./uc_product/uc_product.admin.inc:        array('data' => implode(' ', $operations), 'nowrap' => 'nowrap'),    
./uc_product/uc_product.module:        'cell' => array('data' => variable_get('uc_teaser_add_to_cart_text', t('Add to cart')), 'nowrap' => 'nowrap'),                                                                         
./uc_product/uc_product.module:      $data['list_price'] = array('#value' => uc_price($node->list_price, $context, $options), '#cell_attributes' => array('nowrap' => 'nowrap'));                                             
./uc_product/uc_product.module:      $data['price'] = array('#value' => uc_price($node->sell_price, $context, $options), '#cell_attributes' => array('nowrap' => 'nowrap'));                                                  
./uc_reports/uc_reports.admin.inc:      array('data' => $name, 'nowrap' => 'nowrap'),                          
./uc_reports/uc_reports.admin.inc:      array('data' => l($customer_name, 'user/'. $customer['uid']), 'nowrap' => 'nowrap'),                                                                                                  
./uc_reports/uc_reports.admin.inc:      array('data' => $total_revenue, 'nowrap' => 'nowrap'),                 
./uc_reports/uc_reports.admin.inc:      array('data' => $average_revenue, 'nowrap' => 'nowrap'),               
./uc_reports/uc_reports.admin.inc:        array('data' => "<strong>$revenue_cell</strong>", 'nowrap' => 'nowrap'),                                                                                                            
./uc_reports/uc_reports.admin.inc:        array('data' => "<strong>$gross_cell</strong>", 'nowrap' => 'nowrap'),                                                                                                              
./uc_reports/uc_reports.admin.inc:            array('data' => $breakdown_revenue, 'nowrap' => 'nowrap'),       
./uc_reports/uc_reports.admin.inc:            array('data' => $breakdown_gross, 'nowrap' => 'nowrap'),         
./uc_reports/uc_reports.admin.inc:      array('data' => $date, 'nowrap' => 'nowrap'),                          
./uc_store/uc_store.admin.inc:      array('data' => '<strong>'. $message['title'] .'</strong>', 'nowrap' => 'nowrap'),                                                                                                        
./uc_store/uc_store.admin.inc:        array('data' => uc_price($order->order_total, $context), 'nowrap' => 'nowrap')),                                                                                                        
./uc_order/uc_order.order_pane.inc:              array('data' => $comment->title, 'align' => 'center', 'nowrap' => 'nowrap'),
./uc_order/uc_order.order_pane.inc:      'nowrap' => 'nowrap',
./uc_order/uc_order.order_pane.inc:        '#cell_attributes' => array('align' => 'center', 'nowrap' => 'nowrap'),
./uc_order/uc_order.order_pane.inc:          '#cell_attributes' => array('align' => 'right', 'nowrap' => 'nowrap'),
./uc_order/uc_order.order_pane.inc:        '#cell_attributes' => array('align' => 'right', 'nowrap' => 'nowrap'),
./uc_order/uc_order.order_pane.inc:        '#cell_attributes' => array('align' => 'right', 'nowrap' => 'nowrap'),
./uc_order/uc_order.order_pane.inc:      'nowrap' => 'nowrap',
./uc_order/uc_order.order_pane.inc:        '#cell_attributes' => array('align' => 'center', 'nowrap' => 'nowrap'),
./uc_order/uc_order.order_pane.inc:          '#cell_attributes' => array('align' => 'right', 'nowrap' => 'nowrap'),
./uc_order/uc_order.order_pane.inc:        '#cell_attributes' => array('align' => 'right', 'nowrap' => 'nowrap'),
./uc_order/uc_order.order_pane.inc:        '#cell_attributes' => array('align' => 'right', 'nowrap' => 'nowrap'),
./uc_order/uc_order.order_pane.inc:        '#cell_attributes' => array('align' => 'center', 'nowrap' => 'true'),
./uc_order/uc_order.order_pane.inc:        '#cell_attributes' => array('align' => 'center', 'nowrap' => 'true', 'valign' => 'top'),
./uc_order/uc_order.admin.inc:        array('data' => uc_order_actions($order, TRUE), 'nowrap' => 'nowrap'),
./uc_order/uc_order.admin.inc:        array('data' => check_plain($order_name), 'nowrap' => 'nowrap'),
./uc_order/uc_order.admin.inc:        array('data' => uc_price($order->order_total, $context), 'align' => 'right', 'nowrap' => 'true'),
./uc_order/uc_order.admin.inc:      array('data' => $link, 'nowrap' => 'nowrap'),
./docs/hooks.php:          'nowrap' => 'nowrap',

Are there already plans to address this issue throughout Ubercart. Should I create a patch for the whole lot of errors?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama’s picture

Our CSS is messy and cluttered at best. I'm not sure we were even aware of white-space: nowrap; when we first wrote those modules, and we certainly weren't tuned in with the normal way of outputting HTML for easy theming. We absolutely welcome patches to clean this sort of stuff up, but it's going to be a messy job.

Just for reference, getting a 2.0 out is more important to us than full XHTML validation here. Validation tweaks can happen in point releases after the major release. Therefore, I suspect you'll end up with a large patch that will take some time to test. The best thing to do would be to patch and then post a list of paths to check where HTML has been affected. Even so, I can't promise we'll include the patch before the 2.0 release. I'd make every effort to get it in shortly after.

Thanks for your work!

aacraig’s picture

Okay, I will work on this, but won't rush!

TR’s picture

I would like to revisit this problem. Could you roll a patch to fix the nowrap issue?

TR’s picture

Issue tags: +Ubercart theme layer

Tagging

aacraig’s picture

I can't guarantee that I will be able to get to this anytime soon, so if someone has an urgency for this fix, by all means take the ball and run with it.

longwave’s picture

longwave’s picture

Title: HTML (strict) validation fails » HTML (strict) validation fails: convert nowrap attribute to white-space: nowrap CSS

Better title.

tobiberlin’s picture

where can I remove nowraps from user/[uid]/order/[order-id] ????

trentoncolley’s picture

Line 508, 510, 511, 1048. I don't know if there are others, there is such a function as find and replace that makes finding nowrap exceptionally easy. These are all in uc_order.admin.inc

tobiberlin’s picture

there is such a good practice to create standard compliant code so why are there nowraps at all???

I already removed them and the nowraps still appear under the mentioned path

ohnobinki’s picture

+

TR’s picture

Instead of "+", how about a patch or at least a detailed list of what HTML needs to be changed, and what it needs to be changed to?

TR’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Issue tags: +Novice

Lets fix this in 7.x-3.x first.

longwave’s picture

Category: bug » task

Not really a bug, either.

longwave’s picture

Status: Active » Needs review
FileSize
3.64 KB

Here is a start on this, for uc_cart.

longwave’s picture

Status: Needs review » Active

Committed #15.

longwave’s picture

Status: Active » Needs review
FileSize
10.7 KB

Similar changes for uc_order, also fixes some of #658176: Remove inline CSS

longwave’s picture

And again for uc_product

longwave’s picture

And again for uc_store

longwave’s picture

Status: Needs review » Active

Committed #17, #18, #19.

The only remaining 'nowrap' attributes are in uc_reports.

longwave’s picture

Status: Active » Needs review
FileSize
3.5 KB

This removes the remaining nowraps from 7.x-3.x.

TR’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. I tested all the Ubercart pages against http://validator.w3c.org and I don't see any remaining problems, aside from theme-specific issues. Can you backport these patches to D6?

longwave’s picture

Version: 7.x-3.x-dev » 6.x-2.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed #22. Will port if and when I have time!

longwave’s picture

Committed #22 (uc_reports) to 6.x-2.x as it applied with minor fuzz.

TR’s picture

Status: Patch (to be ported) » Fixed

Backported and committed #15, #17, #18, and #19 to 6.x-2.x. I think we're done here!

Status: Fixed » Closed (fixed)
Issue tags: -Ubercart theme layer, -Novice

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