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.
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | 1719454-line_item_summary-empty_option-7.patch | 6.19 KB | bojanz |
#4 | 1719454-line_item_summary-empty_option-4.patch | 1.54 KB | theo_ |
#1 | 1719454-line_item_summary-and-order_total-views-handler.patch | 1.57 KB | theo_ |
Comments
Comment #1
theo_ CreditAttribution: theo_ commentedHere is the patch
Comment #2
bojanz CreditAttribution: bojanz commentedGood.
Comment #3
rszrama CreditAttribution: rszrama commentedI 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
Comment #4
theo_ CreditAttribution: theo_ commentedThe 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 :
How it is actually :
That's why we need bring back the empty option on Line item summary.
Comment #5
theo_ CreditAttribution: theo_ commentedComment #6
joshmillerPer bojanz.
My concerns:
Patch does what it sets out to do.
Comment #7
bojanz CreditAttribution: bojanz commentedRerolled. rszrama and I agreed that Commerce shouldn't be unsetting $form['empty'] anywhere.
Comment #8
rszrama CreditAttribution: rszrama commentedAnd done.