I get the following error when I delete a node
notice: Undefined index: base in get_query_fields() (line 578 of /public_html/sites/all/modules/date/includes/date_api_filter_handler.inc).
It is being produced by the first line in the following function
function get_query_fields() {
$fields = date_api_fields($this->definition['base']);
$fields = $fields['name'];
$this->query_fields = array();
foreach ((array) $this->options['date_fields'] as $delta => $name) {
if (array_key_exists($name, $fields) && $field = $fields[$name]) {
$date_handler = new date_sql_handler();
$date_handler->construct($field['sql_type'], date_default_timezone_name());
$date_handler->granularity = $this->options['granularity'];
date_views_set_timezone($date_handler, $this->view, $field);
$this->query_fields[] = array('field' => $field, 'date_handler' => $date_handler);
}
}
}
Comments
Comment #1
NROTC_Webmaster commentedI'm wondering if it is ok just to see if the base is set before trying to use it.
I just don't know if it absolutely needs a value that should be set as default or not?
This got rid of the error message and I haven't noticed any adverse side effects yet
Comment #2
NROTC_Webmaster commentedApparently we do need to add an else statement. I had to go back to version 6.x-2.1 to find something prior to what is there now.
In the change log it simply stated - Make sure $base is never empty when identifying date fields for date filter and argument.
I couldn't find a patch that changed this between the two but the else I came up with so far is
Comment #3
pdrake commentedI've combined the above recommendations into a patch for 6.x-2.x-dev.
Comment #4
dagmarI'm having this problem too. I'm afraid the patch is not enough, there is another call to get_query_fields() in the date argument.
Also, this patch includes a $this->ensure_my_table() inside query() because it seem this issue #1034292: Unknown column error for date field in view page display is alive again.
Comment #5
brad.bulger commentedI have been running with this latest patch and it fixes the problems.
Comment #6
jonathan1055 commentedJust had this error after upgrading to PHP5.4 and the patch fixes it. Thanks. For info, the actual code changes apply ok (with offsets) to the non-dev 6.x-2.10
The final change in the patch fails - although this is only there by accident I think, to do with differences in file-end when the patch was created.
Hence, here is a replacement patch with that bit removed. Still RTBC - it's just a cleaner patch.
Jonathan
Comment #7
cafuego commentedCommitted to 6.x-2.x, thanks all :-)