When a view has a date filter it throws the following error:

Undefined index: date_filter in date_views_filter_handler_simple->date_default_value() (line 49 of date/date_views/includes/date_views_filter_handler_simple.inc).

The view seems to work fine so not a critical issue.

Comments

arlinsandbulte’s picture

Status: Active » Postponed (maintainer needs more info)

Have you tried the latest 7.x-2.x?

alexio2170’s picture

Hi, I'm having the same problem but I cannot just run an update. Shall I have to uninstall from scratch? I'm fearing to lose data in my content

jesss’s picture

Version: 7.x-2.0-alpha4 » 7.x-2.x-dev
Status: Postponed (maintainer needs more info) » Active

I'm getting this same error on 7.x-2.x-dev.

jesss’s picture

I did a little digging on this. From what I can tell, here's the problem snippet:

    // If this is a remembered value, use the value from the SESSION.
    if (!empty($this->options['expose']['remember'])) {
      $display_id = ($this->view->display_handler->is_defaulted('filters')) ? 'default' : $this->view->current_display;
      return $_SESSION['views'][$this->view->name][$display_id]['date_filter'][$prefix];
    }

If I'm reading this right, it's looking for the remembered filter value. But, if no filter has yet been set, there's no value for it to return, so it's throwing an error.

So, in addition to checking if the value should be remembered, there should probably be some logic checking to make sure there is a value to remember in the first place. However, actually coding that logic is beyond my capabilities.

As confirmation, if I remove the option to remember the last selection, the error message goes away.

ckuepker’s picture

Got a similar error. Specifically:

Undefined index: views in date_views_filter_handler_simple->date_default_value() (Line 49...

which was caused by a date filter in views. The suggestion by #4 jesss worked. Disable "Remember last decision" in exposed filter, notice gone. Thank you.

mesr01’s picture

+1

CMS’s picture

Had a similar issue, even though i did not have the remember the last selection checked, editing the view and applying settings for the exposed filter made it go away.

HTH

karens’s picture

Status: Active » Fixed

Should be fixed now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.