When a new product display is created an empty 'class' shows up in front of the title of the product variation. Removing it is only possible by opening the 'manage display' of the product display and resaving the 'format settings' of the title(no change is needed).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marktheshark’s picture

Confirming issue & solution on my installation.

jsacksick’s picture

Project: Commerce Kickstart » Title
Version: 7.x-2.0 » 7.x-1.x-dev

This is an issue with the title module, the guilty line is the following :

  $wrap_tag = isset($settings['title_style']) ? $settings['title_style'] : '_none';

We have two solutions, either replace the default value of the title_style settings in the
title_field_formatter_info() declaration or correct the previous check by the following :

  $wrap_tag = !empty($settings['title_style']) ? $settings['title_style'] : '_none';
jsacksick’s picture

Status: Active » Needs review
FileSize
520 bytes

Attached patch needs review

jsacksick’s picture

This new patch also fixes other isset checks.

Status: Needs review » Needs work

The last submitted patch, title-fix-empty-class-in-title-1885358-4.patch, failed testing.

sonneworks’s picture

tried this on my drupal site and it works, thanks! (the first patch)

plach’s picture

plach’s picture

Status: Needs work » Closed (duplicate)

Reopen if I was wrong in #7.

drupalreggie’s picture

What is the best solution for this currently? I'm hoping to launch a production site soon using Commerce Kickstart and this is kind of a major issue.

I've been emulating the demo product variation display settings with my new product variation. This results in some aesthetic improvements but now my product links do not work when it is viewed in a product list.

I'm using commerce kickstart installation profile 7.x 2.0

plach’s picture

Install the lastest Title dev.

drupalreggie’s picture

Sorry - what / where is the latest title dev? Will this also fix the other display issues;

  • I cannot change the order of the field display in the product list view (see image)
  • None of the field are linking to the product
drupalreggie’s picture

FileSize
59.83 KB

Image

jsacksick’s picture

Well the patch from #1885356: Empty HTML class in Linked and wrapped format is for me still incomplete, because the isset check is still there.
$wrap_tag = isset($settings['title_style']) ? $settings['title_style'] : '_none';
The title_style is always set, so the result of the other patch would still be a wrapped tag even if you haven't configured the formatter yet.
--- Edit ---
I've just noticed that weeks later the fix has been commited here #1919640: Empty tag shown when the title field is displayed.