I am getting an error that says:

Notice: Undefined index: settings in date_formatter_process() (line 187 of C:\Users\ashorter\Sites\cocoa\sites\all\modules\date\date.module).

when I am trying to execute

<?php $value = field_extract_values('node', $node, 'field_gantt_bid'); echo $value[0]; ?>

I created this input type using the date module and it includes a "through" date...so a start and finish date. I can see through devel that the end date is listed with the key 'value2'. I am able to get to this value by executing

<?php $value = field_extract_values('node', $node, 'field_gantt_design', array('key' => 'value2')); echo $value[0]; ?>

but this generates the same error. I am using the 7.x-2.0-rc1 version of the date module.

If the error cannot be fixed, is there a way to override the dependency on the date module and just pull this as a string?

This module is an AWESOME time saver. Thanks to all who are contributing.

Comments

adaddinsane’s picture

Assigned: Unassigned » adaddinsane

There's probably been a change to the date module - frankly what I'm doing when it comes to dates is a hack, it would be nice if this module was popular enough to get support in Date. One day perhaps :-)

I'll take a look this evening and see if I can work up a patch.

adaddinsane’s picture

Status: Closed (works as designed) » Active

Okay I've had a look. In fact it's the Date module that's at fault because it assumes (in the routine I call) that there is a $display['settings'] entry in the $display array - which is the one at the end of the call.

If you look at other calls to this routine by Date itself it does exactly the same thing and delivers an empty $display array, which means those functions will generate the same error as mine.

On production sites you will normally have Notices turned off so it's not seen. This is pretty bad though (IMO), any site that uses dates is going to be filling up Watchdog with these notices, and every call to Watchdog slows down the code.

If you want to modify the Date module with:

$settings = isset($display['settings']) ? $display['settings'] : array();

That will do the trick but doesn't really fix the overall issue, and I know they are doing some major work on this function. Perhaps you'd like report the issue and let them worry about the proper fix.

adaddinsane’s picture

Status: Active » Closed (works as designed)
mxh’s picture

Status: Active » Closed (works as designed)

according to http://drupal.org/node/1507414, the date module won't be changed at this. So you should adapt your function call to the date module's specification. In the call, there should be array('settings' => array()) or similar when you give the date's function the parameter for the display array.

mxh’s picture

Status: Closed (works as designed) » Needs work
jeroen.b’s picture

Status: Needs work » Patch (to be ported)
StatusFileSize
new2.02 KB

Date.inc had an empty array in the last argument, but that array should contain a (empty) settings array.

adaddinsane’s picture

I'll get to this next week - I'm a bit busy shooting part of a webseries this week, I'm the writer and producer :-/

Stay tuned to hashtag #winter8 on Sunday.

http://igg.me/p/93585?a=405734

End of advert.

adaddinsane’s picture

Status: Patch (to be ported) » Closed (fixed)

Committed to 7.x-1.x-dev

Project: » Lost & found issues

This issue’s project has disappeared. Most likely, it was a sandbox project, which can be deleted by its maintainer. See the Lost & found issues project page for more details. (The missing project ID was 1158878)