When you use one of those handlers under the "no results behavior" views section, they just don't get displayed at all, when your view is empty.

Actually we are only checking for empty content, but this settings was wrong in views (see #1677784: $empty argument of the area handler render() is FALSE for the empty area.), so it worked kind of magic until views get fixed.

So now we need to check for the correct value which mean we want to check the 'empty content' for regular case and 'empty option' ("Display even if view has no result") used for 'no results behavior' case.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

theo_’s picture

Status: Active » Needs review
FileSize
1.57 KB

Here is the patch

bojanz’s picture

Status: Needs review » Reviewed & tested by the community

Good.

rszrama’s picture

Title: Line item summary & Order total views handlers not displayed since views get fixed » Allow the Order Total area handler to render to empty Views
Component: Developer experience » Views integration
Assigned: theo_ » Unassigned
Category: bug » feature
Status: Reviewed & tested by the community » Fixed

I was waiting for a new release of Views to come out to pursue this, and though I talked it over with bojanz in Paris, I can't remember the result of our conversation. However, looking at this again today, I don't see a reason to change the current behavior of the line item summary handler (it's meaningless if there are no line items in the result set) and I actually need to update the order total area handler to not try to render when a valid order couldn't be loaded. I can see why that might need to be displayed in the empty text area if perhaps some filter prevented results from appearing but a valid order argument was found.

So, I'll commit half of this and this some. : D

Oh, I also removed the unset($form['empty']); from the options form for the order total handler. If we're going to support it, we may as well make the option available again (even if it's never used ; ).

Commit: http://drupalcode.org/project/commerce.git/commitdiff/4b4fe4d

theo_’s picture

The issue is back on kickstart.

The fact is that we want to display the Line item summary in any case to have a consistent design.

How it used to & should be :
kickstart_v2_cart_block.png

How it is actually :
kickstart_v2_cart_block_broken.png

That's why we need bring back the empty option on Line item summary.

theo_’s picture

Status: Fixed » Needs review
joshmiller’s picture

Status: Needs review » Reviewed & tested by the community

Per bojanz.

My concerns:

  • I prefer there be nothing in my checkout prior to adding anything to my cart.
  • I prefer the empty, non-zero-currency, non-linking to an empty checkout link way

Patch does what it sets out to do.

bojanz’s picture

Rerolled. rszrama and I agreed that Commerce shouldn't be unsetting $form['empty'] anywhere.

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

And done.

Status: Fixed » Closed (fixed)

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