Download & Extend

Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 64

Project:Date
Version:7.x-2.x-dev
Component:Views Filter
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

drupal 7, views 3 rc 3

in views 3 condiguration:
filter criteria:
'Date From'
yes - expose this filter to visitors...
is equal to
date value: select a date (entered a default value)
no - remember the last action

(same settings for the 'date to' criteria)

advanced settings:
exposed form in block : Yes
use ajax:no
use aggregation: No
caching:None

however i get an error on the page:
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 64 of I:\My Documents\web\xampp\htdocs\mysite\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_parts_form() (line 316 of I:\My Documents\web\xampp\htdocs\mysite\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 64 of I:\My Documents\web\xampp\htdocs\mysite\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 64 of I:\My Documents\web\xampp\htdocs\mysite\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 64 of I:\My Documents\web\xampp\htdocs\mysite\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in views_handler_filter_date->accept_exposed_input() (line 97 of I:\My Documents\web\xampp\htdocs\mysite\sites\all\modules\views\handlers\views_handler_filter_date.inc).

I attached also how the views resulted with a small question mark in the filter field.
Click to view image

Tried looking for some patches but cannot seem to find any...

Thanks!

Comments

#2

Status:active» postponed (maintainer needs more info)

Unable to reproduce this. There are hundreds of permutations of ways you could have constructed date fields and then set up views using those fields. Unless you can tell me how to reproduce this issue there is nothing I can do. I have dozens of fields and numerous views and none of them produce errors like this.

#3

Status:postponed (maintainer needs more info)» closed (cannot reproduce)

No response, cannot reproduce.

#4

Status:closed (cannot reproduce)» active

Apologies for reopening a closed issue, but these step reproduce the errors in the original post. Let me know if you'd prefer a new issue be created instead.

Steps to reproduce:

  1. Enable only the Date and Date API modules
  2. Add a new field to a content type -- Name: custom date; Field: Date; Widget: Select; limit granularity to Year, Month, Day. (not sure if the last part is necessary, but that's what I was doing...)
  3. Create a new view, add a Date field filter, check the Expose filter option, Apply
  4. Add a Page display with the path "test". Save the view
  5. Enable the Date Views module
  6. Go to /test

The latest release of Date has the errors at lines 73 and 99 instead of 64 and 97 as originally reported.

Should the option to add a Date-based field to a View even be shown before the Date Views module is enabled? It seems like that's the root problem. Note that the filter operators are the same as those allowed for a text filter before Date Views is enabled (begins with, contains, ends with, etc).

To fix the warnings: edit the Date filter, click apply, and save the view. Note that the filter operator options have changed to what we would normally expect for a date filter (greater than, less than, etc.)

#5

I think i have the same problem:
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 73 of C:\AppServ\www\pk\web\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_parts_form() (line 344 of C:\AppServ\www\pk\web\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 73 of C:\AppServ\www\pk\web\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 73 of C:\AppServ\www\pk\web\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 73 of C:\AppServ\www\pk\web\sites\all\modules\date\date_views\includes\date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in views_handler_filter_date->accept_exposed_input() (line 99 of C:\AppServ\www\pk\web\sites\all\modules\views\handlers\views_handler_filter_date.inc).

Exposed one date fileld in view table list.

#6

I "fixed" this by editing the filter, setting a value for "Select a date" then saving, editing the filter again, removing the "Select a date" then saving again.
So seems the issue is that the field value is not being initialised properly when it should be empty by default.

#7

Thanks to akamustang, his fix cleared my issue as well. FWIW, I wouldn't see the error from the admin/views preview but rather on the page I created for the filtered view.

#8

akamustang thanks.. worked fine here!

#9

thanks akamustang, this worked for me as well

#10

Same error:
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 73 of /var/www/com/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_parts_form() (line 344 of /var/www/com/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 73 of /var/www/com/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 73 of /var/www/com/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in date_views_filter_handler_simple->date_default_value() (line 73 of /var/www/com/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc).
Notice: Uninitialized string offset: 0 in views_handler_filter_date->accept_exposed_input() (line 132 of /var/www/com/sites/all/modules/views/handlers/views_handler_filter_date.inc).

Though a "fix" seems to exist the module should be corrected to take this into account.

nobody click here