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.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | field_extract_date.inc_date_formatter_settings_fix.patch | 2.02 KB | jeroen.b |
Comments
Comment #1
adaddinsaneThere'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.
Comment #2
adaddinsaneOkay 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.
Comment #3
adaddinsaneComment #4
mxh commentedaccording 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.
Comment #5
mxh commentedComment #6
jeroen.b commentedDate.inc had an empty array in the last argument, but that array should contain a (empty) settings array.
Comment #7
adaddinsaneI'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.
Comment #8
adaddinsaneCommitted to 7.x-1.x-dev