In commerce_line_item_field_widget_form() it looks like this is using the D6 approach of removing titles by unset():
unset($widget_form['commerce_unit_price'][$language][0]['amount']['#title']);

Rather than simply setting the title_display:
https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...

Setting '#title_display' => 'invisible' allows the form to retain it's accessibility while removing the visual elements which have been deemed unnecessary.

There may be other instances of this, but found this by grepping through the code.

Comments

michfuer’s picture

Status: Active » Needs review
StatusFileSize
new916 bytes

Here's a patch for that.

mgifford’s picture

It applies nicely. Just not sure how to test for this. Where is it exposed?

rszrama’s picture

Category: Bug report » Task
Issue tags: +sprint
mglaman’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new7.32 KB

This allows the label for the unit price field to be available inside the widget table when managing orders, or other areas this widget is used.

Example of output (used inspector to remove class from one label)

  • mglaman committed ea682b0 on 7.x-1.x authored by michfuer
    Issue #2367533 by michfuer: Commerce should use '#title_display' => '...
mglaman’s picture

Status: Reviewed & tested by the community » Fixed

Committed!

Status: Fixed » Closed (fixed)

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