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.
Currently the Views field handlers for Commerce Orders that generate links to orders (view/edit/delete) don't validate if there is an order id, they just presume it is there and generate a link.
I use a View of entities that can reference orders, but the View currently always shows a link even if there is no referenced order in the entity (the generated link is ofcourse broken and gives a 404 page).
I will attach a patch that checks if a order_id is known, and only then generates a link.
Len
Comment | File | Size | Author |
---|---|---|---|
#1 | order_view_link_handlers-2262851-1.patch | 4.13 KB | Lendude |
Comments
Comment #1
LendudeHere is the patch
Comment #2
rszrama CreditAttribution: rszrama commentedHmm, is there something we should be doing w/ the empty value settings instead?
Comment #3
LendudeThe way it works with the #1 patch is that if no order_id is found the field render comes back empty so Views just falls back to it's normal 'empty' behavior. So if you enter an 'empty text' in the field settings that text will be shown instead of nothing. So these settings are used.
Or are you thinking in another direction?
Comment #4
rszrama CreditAttribution: rszrama commentedTagging for http://contribkanban.com/#/board/commerce/7.x-1.x.