Every time I publish content containing a date-repeat field I see this error after publising.
I don't know what it means. Just to let you guys know.

* Notice: Undefined index: #date_flexible in date_select_input_date() (line 564 of /mounted-storage/home146/sub016/sc78647-ZLRI/mysite/sites/all/modules/date/date_api/date_api_elements.inc).
* Notice: Undefined index: #date_flexible in date_select_input_date() (line 564 of /mounted-storage/home146/sub016/sc78647-ZLRI/mysite/sites/all/modules/date/date_api/date_api_elements.inc).
* Notice: Undefined index: #date_flexible in date_select_input_date() (line 564 of /mounted-storage/home146/sub016/sc78647-ZLRI/mysite/sites/all/modules/date/date_api/date_api_elements.inc).
* Notice: Undefined index: #date_flexible in date_select_input_date() (line 564 of /mounted-storage/home146/sub016/sc78647-ZLRI/mysite/sites/all/modules/date/date_api/date_api_elements.inc).

Comments

dkhill’s picture

Not too bad for "Alpha" code. It looks as though the .INC file is making reference to array. I just looked at the .inc file and it looks ok, syntatically.
I'm having the same issue as well. I looked at the array definition and it appears to be defined and spelled correctly.
I'll leave it up to the experts!!

Notice: Undefined index: #date_flexible in date_select_input_date() (line 568 of /home/mysite/public_html/sites/all/modules/date/date_api/date_api_elements.inc).

dkhill’s picture

Issue tags: +modules, +notice, +undefined index, +#date_flexible, +date_select_input_date(), +line 568, +date_api_elements.inc
arlinsandbulte’s picture

Status: Active » Closed (won't fix)

Date 7.x-1.x is unsupported.
This issue should be verified in the latest version of Date (7.x-2.x-dev) and re-opened if still valid.

Thanks

pjbarry21’s picture

Version: 7.x-1.0-alpha2 » 7.x-2.x-dev
Status: Closed (won't fix) » Active

Seems to be the same or a related issue issue. Tried to create a node with a repeating date. I have version 7.x-2.x-dev installed.

Also, I get this error when I try to create a calendar item (unsure if it's related):
Notice: Undefined index: repeat_collapsed in _date_repeat_widget() (line 45 of /home/sitename/public_html/sites/all/modules/date/date_repeat.inc).
*****************
Error from the date_api_elements.inc file is:

Notice: Undefined index: #date_flexible in date_select_input_date() (line 549 of /home/sitename/public_html/sites/all/modules/date/date_api/date_api_elements.inc).
*************

Line 549:

if ($date->validGranularity($granularity, $element['#date_flexible'])) {

Lines 529-555:

/**
* Helper function for creating a date object out of user input.
*/
function date_select_input_date($element, $input) {
if (empty($input) || !is_array($input) || !array_key_exists('year', $input) || empty($input['year'])) {
return NULL;
}
$granularity = date_format_order($element['#date_format']);
if (isset($input['ampm'])) {
if ($input['ampm'] == 'pm' && $input['hour'] < 12) {
$input['hour'] += 12;
}
elseif ($input['ampm'] == 'am' && $input['hour'] == 12) {
$input['hour'] -= 12;
}
}
unset($input['ampm']);
$date = new DateObject($input, $element['#date_timezone']);
if (is_object($date)) {
$date->limitGranularity($granularity);
if ($date->validGranularity($granularity, $element['#date_flexible'])) {
date_increment_round($date, $element['#date_increment']);
return $date;
}
}
return NULL;
}

karens’s picture

Status: Fixed » Closed (fixed)

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

merryfknpoppins’s picture

I am having the same problem actually.. I notice it is closed. What was the solution to this? Its not really stated. I have run through the proper steps to make sure it wasn't me. Have tried the dev version.

Here is my error codes

* Notice: Undefined index: #date_flexible in date_select_input_date() (line 549 of /home/westmain/public_html/sites/all/modules/date/date_api/date_api_elements.inc).
* Notice: Undefined index: #date_flexible in date_select_input_date() (line 549 of /home/westmain/public_html/sites/all/modules/date/date_api/date_api_elements.inc).
* Notice: Undefined index: #date_flexible in date_select_input_date() (line 549 of /home/westmain/public_html/sites/all/modules/date/date_api/date_api_elements.inc).

I am looking at the function it is calling.

function date_select_input_date($element, $input) {
  if (empty($input) || !is_array($input) || !array_key_exists('year', $input) || empty($input['year'])) {
    return NULL;
  }  
  $granularity = date_format_order($element['#date_format']);
  if (isset($input['ampm'])) {
    if ($input['ampm'] == 'pm' && $input['hour'] < 12) {
      $input['hour'] += 12;
    }
    elseif ($input['ampm'] == 'am' && $input['hour'] == 12) {
      $input['hour'] -= 12;
    }
  }
  unset($input['ampm']);
  $date = new DateObject($input, $element['#date_timezone']);
  if (is_object($date)) {
    $date->limitGranularity($granularity);
    if ($date->validGranularity($granularity, $element['#date_flexible'])) {
      date_increment_round($date, $element['#date_increment']); 
      return $date;
    }  
  }
  return NULL;
}

What is going on with #date_flexible

merryfknpoppins’s picture

Status: Closed (fixed) » Active

opening the issue back up for a review

TripX’s picture

same issue here. Just created a new field on an existing content type and after saving, this message appears.

karens’s picture

Status: Active » Postponed (maintainer needs more info)

I cannot reproduce this problem. I need enough information to reproduce it. #date_flexible is set by the code that creates the date field, if it is not set you are probably doing something non-standard that is bypassing the place where it is set, but without the specific steps to reproduce the problem (including details about how the field is set up and what widget you are using and what value you are trying to input into it), there is nothing I can do.

sharonknieper’s picture

Status: Postponed (maintainer needs more info) » Active

Hi KarenS,

I used these steps to replicate it:
1. A clean standard install of Drupal 7.4.
2. Dev version of Date from July 5th.
3. Added a date field (select list with repeat options) to article content type. All configuration of the date field was left at defaults.
4. Created a test article starting July 6th at 5:48 and repeating every day until Jan 1 2012.

Result:

Notice: Undefined index: #date_flexible in date_select_input_date() (line 571 of [path to drupal]/sites/all/modules/date/date_api/date_api_elements.inc).
Notice: Undefined index: #date_flexible in date_select_input_date() (line 571 of [path to drupal]/sites/all/modules/date/date_api/date_api_elements.inc).

The content does save.

Another thing I noticed that seemed kinda weird was that even though I did not select it it saves today as an 'exception' date.

sharonknieper’s picture

should've specified I enabled Date, Date API, and Date Repeat API.

karens’s picture

Status: Active » Fixed

The last issue has since been fixed. It is different than the original issue which was also fixed. Please don't open old issues and change them ('Now I'm seeing this different message...').

Status: Fixed » Closed (fixed)
Issue tags: -modules, -notice, -undefined index, -#date_flexible, -date_select_input_date(), -line 568, -date_api_elements.inc

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

Issue tags: +modules, +notice, +, +, +, +, +
avpaderno’s picture

Issue summary: View changes
Issue tags: -#date_flexible, -date_select_input_date(), -line 568, -date_api_elements.inc