Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#21 | 556458-nowrap-uc_reports.patch | 3.5 KB | longwave |
#19 | 556458-nowrap-uc_store.patch | 2.29 KB | longwave |
#18 | 556458-nowrap-uc_product.patch | 2.16 KB | longwave |
#17 | 556458-nowrap-uc_order.patch | 10.7 KB | longwave |
#15 | 556458-nowrap-uc_cart.patch | 3.64 KB | longwave |
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedOur 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!
Comment #2
aacraig CreditAttribution: aacraig commentedOkay, I will work on this, but won't rush!
Comment #3
TR CreditAttribution: TR commentedI would like to revisit this problem. Could you roll a patch to fix the nowrap issue?
Comment #4
TR CreditAttribution: TR commentedTagging
Comment #5
aacraig CreditAttribution: aacraig commentedI 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.
Comment #6
longwave#1166780: Remove "nowrap" attributes from table in orders overview page for customers marked as duplicate
Comment #7
longwaveBetter title.
Comment #8
tobiberlinwhere can I remove nowraps from user/[uid]/order/[order-id] ????
Comment #9
trentoncolley CreditAttribution: trentoncolley commentedLine 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
Comment #10
tobiberlinthere 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
Comment #11
ohnobinki CreditAttribution: ohnobinki commented+
Comment #12
TR CreditAttribution: TR commentedInstead 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?
Comment #13
TR CreditAttribution: TR commentedLets fix this in 7.x-3.x first.
Comment #14
longwaveNot really a bug, either.
Comment #15
longwaveHere is a start on this, for uc_cart.
Comment #16
longwaveCommitted #15.
Comment #17
longwaveSimilar changes for uc_order, also fixes some of #658176: Remove inline CSS
Comment #18
longwaveAnd again for uc_product
Comment #19
longwaveAnd again for uc_store
Comment #20
longwaveCommitted #17, #18, #19.
The only remaining 'nowrap' attributes are in uc_reports.
Comment #21
longwaveThis removes the remaining nowraps from 7.x-3.x.
Comment #22
TR CreditAttribution: TR commentedLooks 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?
Comment #23
longwaveCommitted #22. Will port if and when I have time!
Comment #24
longwaveCommitted #22 (uc_reports) to 6.x-2.x as it applied with minor fuzz.
Comment #25
TR CreditAttribution: TR commentedBackported and committed #15, #17, #18, and #19 to 6.x-2.x. I think we're done here!