1) Create new view for content
2) Add an argument of type "Updated day", "Updated month" or "Updated year" (possibly others, I haven't tested beyond these three)
3) Leave all values as default
4) Set path to "test"
5) Visit "test/all"
I receive a pair of error messages:
Warning: date_timezone_set() expects parameter 1 to be DateTime, boolean given in format_date() (line 1909 of /home/vend/public_html/includes/common.inc).
Warning: date_format() expects parameter 1 to be DateTime, boolean given in format_date() (line 1919 of /home/vend/public_html/includes/common.inc).
These seem to stem from the various title() functions in views_handler_argument_dates_various.inc. Given the above URL, $this->argument is "all" rather than a valid integer, leading strtotime to fail and return False.
The errors appear harmless - the view still displays properly.
I don't know what should be happening here, but seeing an error while using an argument with all the defaults intact isn't it. See the attached view for a very simple example of what triggers these errors. I'm running Drupal 7.8 with Views-7.x-3.x-dev as of ten minutes ago.
| Comment | File | Size | Author |
|---|
Comments
Comment #1
dawehnerCurrently the problem is that if there is 'all' $this->argument is 'all' and so the title() function does some silly things.
Additional there is a exception_title function, which assumes that you want to display the default title, if there is no special exception value set, but i think this is wrong, because you can't be sure about the type of argument you are at. For numeric handlers 'all' might not be a valid value.
So i think it should return nothing if there is no exception title set.
Comment #2
nathanjo commentedI still encounter this error. Views 7.x-3.3.
Contextual Filter: Created year + month
When you are returning 'all' it will result an error
I just need to return 'all' to display all results if condition doesn't match.
Comment #3
juanramonperez commentedI have the same problem
Steps to reproduce
1) Create new view for content
2) Add an argument "Created date"
3) Visit path/to/view/all
Any solution?
Comment #4
Luisvsm commentedSub
Comment #5
markusa commentedThis is still happening...
Views 3.11
Comment #6
fastangel commentedI did a little patch to fix this problem.
Comment #7
fastangel commentedComment #8
fastangel commentedSorry I forgot remove a dpm.
Comment #9
chris matthews commentedThe 4 year old patch in #8 to views_handler_argument_dates_various.inc does not apply to the latest views 7.x-3.x-dev and if still relevant needs to be rerolled.
Comment #10
andrew answer commentedThe current Views have following code here:
I test Created/Updated date contextual filter with view on fresh D7 site and not found any errors. So I recommend to close this issue as fixed.