Issue based on today's IRC discussion.

    // Only display the title and status on the full page view.
    if ($view_mode == 'full') {
      $content['title'] = array(
        '#markup' => theme('commerce_product_title', array('title' => $product->title, 'label' => t('Title:'), 'product' => $product)),
        '#attached' => $attached,

      $content['status'] = array(
        '#markup' => theme('commerce_product_status', array('status' => $product->status ? t('Active') : t('Disabled'), 'label' => t('Status:'), 'product' => $product)),
        '#attached' => $attached,

There is no sane reason to limit those two fields to the "full" view mode. The title is added as an "extra field" to all view modes, so the fact that certain view modes just don't get that data is a bug. And the status should be added as an "extra field", but isn't.
I guess most people don't notice because the title is added as an h2 by the entity template anyway (which is a whole different awkward story).

#1 1620014-fix-title-status.patch2.45 KBbojanz
PASSED: [[SimpleTest]]: [MySQL] 3,568 pass(es). View


bojanz’s picture

Status: Active » Needs review
2.45 KB
PASSED: [[SimpleTest]]: [MySQL] 3,568 pass(es). View

We've had this bug for ages. Time to fix it.

vasike’s picture

Status: Needs review » Reviewed & tested by the community

tried, all it looks right.
question: should status "display" field have a formatter?

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

It's what's known as an extra field, which is really just the representation of an entity property in a view mode. It can be positioned on the manage display tab in relation to other fields and extra fields, but it will only be rendered through its theme function. I've added a template preprocess function in conjunction with this patch to make sure we render the text "Active" or "Disabled" instead of just 1 or 0.

Status: Fixed » Closed (fixed)

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