Notice happens when adding exposed date filter (between) for the date from field.

Comments

dealancer’s picture

Status: Active » Needs review
StatusFileSize
new809 bytes

Here is a patch. Please review.

Status: Needs review » Needs work

The last submitted patch, date-views_exposed_filter-1464280-1.patch, failed testing.

rylowry@gmail.com’s picture

I was looking at another issue (http://drupal.org/node/1425774) where this notice was mentioned. Here is a workaround that got rid of the notice for me, though I'm not sure what caused the original problem.

function hook_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'views_exposed_form' && isset($form['field_your_date_field'])) {
    $form['field_your_date_field']['value']['#date_format'] = 'Y-M-d';
  }
}
dealancer’s picture

Thanks for the snippet, it should work. However we would like to have a path.

The problem is when operator is between or between not, we don't have $form['field_your_date_field']['value'], instead we have $form['field_your_date_field']['min'] and $form['field_your_date_field']['max'].

nagiek’s picture

The patch in #1 should work. Re-roll it?

Georgique’s picture

Confiriming issue and subscribe

Georgique’s picture

StatusFileSize
new723 bytes
nagiek’s picture

Status: Needs work » Needs review

Setting bot

Status: Needs review » Needs work

The last submitted patch, date_views.patch, failed testing.

Georgique’s picture

I don't know how to make patches in right format. Just think that my correction in code is right...

dealancer’s picture

The first four lines of a patch a bit wrong. It should be

diff --git a/date_views.module b/date_views.module
index 0f4e128..e54bbe3 100644
--- a/date_views.module
+++ b/date_views.module

instead of

diff --git a/a/date_views.module b/b/date_views.module
index 0f4e128..e54bbe3 100644
--- a/a/date_views.module
+++ b/b/date_views.module
Georgique’s picture

Status: Needs work » Needs review
StatusFileSize
new715 bytes

Fixed patch

Status: Needs review » Needs work

The last submitted patch, date_views.patch, failed testing.

Georgique’s picture

StatusFileSize
new758 bytes

I suggest there should be path to date_views directory. Next try =)

Georgique’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, date_views.patch, failed testing.

khandra’s picture

Hello all,
in my humble opinion, the patch is not working because there is a missing parenthesis on the last line.
In current file I read:
foreach ($granularity as $part)

instead it should be
foreach ($granularity as $part) {

hope this helps!

geerlingguy’s picture

Version: 7.x-2.2 » 7.x-2.x-dev
Status: Needs work » Needs review
StatusFileSize
new0 bytes

Patches should be against -dev branch, and need to be made against a git checkout, in the root folder of the date module. Read more here: Making patches for Drupal with Git.

Attached updated patch.

geerlingguy’s picture

StatusFileSize
new759 bytes

Well, it would help if I attached a real patch...

karens’s picture

Status: Needs review » Fixed

I can replicate this. Fixed now. Thanks guys!

http://drupalcode.org/project/date.git/commit/0514a92

laraz’s picture

#19: Thanks. It worked for me.

Status: Fixed » Closed (fixed)

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