Closed (fixed)
Project:
Drupal core
Version:
8.9.x-dev
Component:
views.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 May 2018 at 06:09 UTC
Updated:
19 Feb 2021 at 00:09 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
L-four commentedComment #4
matiasmirandaI think that in case of an invalid value, the default value should be taken from the parent class, instead of forcing an empty string, for example when a default value for "All" is provided:

I attach a patch
Comment #5
daffie commentedThe basic solution look good. For both code changes I would like to improve the code a little:
Can we change this to:
Now we need automated tests so that this fix will not be undone in the future.
Comment #7
kunalgautam commentedComment #8
kunalgautam commented@daffie I updated the patch
Comment #9
kunalgautam commentedComment #10
daffie commented@kkalashnikov: Thank you. Could you also create the necessary tests?
Comment #12
raman.b commentedAdding some test coverage for this
Comment #14
lendudeNice test coverage!
Wouldn't it be better to catch the thrown exception instead of making an assumption about what the date formatter service does?
So just wrap the original code in a try/catch and return the parent call in the catch?
If we are not using a try/catch at least it seems like the date formatter is injected, so lets use that and not \Drupal:: (like in the original code)
Comment #15
raman.b commentedThanks for the review @Lendude!
I like the idea of catching the exception and returning the parent call. Uploading a patch implementing the same.
Comment #16
lendudeLooks great, nice work!
Comment #17
catchCommitted/pushed to 9.2.x and cherry-picked to 9.1.x
This should go into 8.9.x too, but leaving at 'to be ported' for a little while since we just did the patch release yesterday evening so still thawing.
Comment #21
catchCherry-picked to 8.9.x
Comment #23
xjmThe cherry-pick broke 8.9.x HEAD on all environments: https://www.drupal.org/pift-ci-job/1965195
Comment #24
alexpottON Drupal 8.9 this needs to be public.
Comment #25
alexpottHere's a fix.
Comment #26
catchComment #28
xjmThat'd do it.
Committed the backport to 8.9.x. Thanks!