I couldn't find this error in the issue queue, but I'm receiving it very often: after a cache flush, when visiting structure>views, after saving a view, after enabling modules, and many other occasions. Refreshing the page temporarily rids the error, and I've noticed this with all roles.
The error:
Notice: Undefined index: vocabulary in taxonomy_field_views_data() (line 415 of <path>/sites/all/modules/views/modules/taxonomy.views.inc).
taxonomy.views.inc line 415:
$data[$table_name][$field_name]['filter']['vocabulary'] = $field['settings']['allowed_values'][0]['vocabulary'];
taxonomy.views.inc conflicting function (I commented // HERE after it):
/**
* Implements hook_field_views_data().
*
* Views integration for taxonomy_term_reference fields. Adds a term relationship to the default
* field data.
*
* @see field_views_field_default_views_data()
*/
function taxonomy_field_views_data($field) {
$data = field_views_field_default_views_data($field);
foreach ($data as $table_name => $table_data) {
foreach ($table_data as $field_name => $field_data) {
if (isset($field_data['filter'])) {
$data[$table_name][$field_name]['filter']['handler'] = 'views_handler_filter_term_node_tid';
$data[$table_name][$field_name]['filter']['vocabulary'] = $field['settings']['allowed_values'][0]['vocabulary']; // HERE
}
}
// Add the relationship only on the tid field.
$data[$table_name][$field['field_name'] . '_tid']['relationship'] = array(
'handler' => 'views_handler_relationship',
'base' => 'taxonomy_term_data',
'base field' => 'tid',
'label' => t('term from !field_name', array('!field_name' => $field['field_name'])),
);
}
return $data;
}
Comments
Comment #1
dawehnerIt's not so hard to open a file and look after this line :)
Can you please write something like dvm or similar to look which field has this problem?
Then look at this field and see whether you have a vocabulary selected or not.
Comment #2
ownage commentedI found it was the Migrate Examples module conflicting. Upon deleting all the vocabularies and content types the module populated, the notice cannot be duplicated.
Comment #3
timothykc commentedDitto for me. Errors appeared after installing Migrate Examples, and disappeared after deleting the vocab/content type.
Comment #5
AlternateRoute commentedIt is hard to say it is fixed if you have to delete all the vocabularies and content types that were imported.
A better solution would be if there was a way to identify the specific vocabulary or content type causing the problem and then fix it.
Comment #6
Anonymous (not verified) commentedI reopen this issue because I have the same error and cannot find the cause. I did not use the Migrate Examples module.
What I did:
- I made two taxonomy vocabularity items
- I changed the default taxonomy system name
- I used taxonomy_csv, to import terms but the import was not succesfull.
- So I uninstalled taxonomy_csv
- I added the terms by hand
- I made a contenttype with a term relation field
- I made a view with this content type
- Then I noticed this error
- Searching for a solution I deleted al the taxonomy vocabularity items, the view and the term relation field,
- And made a new setup clean, by hand.
The error is stil there: generated two times with the same error text,
The error is not always on screen, only after cache flushing or opening admin/structure/views.
Comment #7
dawehnerPlease have a look whether you have a taxonomy reference field without a vocabulary selected.
This is basically the problem here all the time.
Comment #8
Anonymous (not verified) commentedI found field_name 'taxonomy_relation' (type 'taxonomy_term_reference') in de database-field 'field_config' and did not recognize this field. This field is not shown in drupal admin/reports/fields. The error is gone after deleting this field in the database.
I don't know where the field is from, possible a leftover from a deleted module, with a not correct working uninstall. I am not sure I did the correct thing. The error is gone.
Comment #9
dawehnerUpdate status.
Comment #10
GlobalRaj commentedWhen ever I was loading Structure > Views or did any other activities with Views, I kept getting the following error.
Notice: Undefined index: vocabulary in taxonomy_field_views_data() (line 415 of
/sites/all/modules/views/modules/taxonomy.views.inc).
The same error repeats for 11 more times
But after going through above postings, I went ahead and disabled the Migrate Example. That seemed to have solved the issue. But I think some work needs to be done (Views / Migrate) in order for that error to not come up.
Cheers!
Raj
Comment #11
dawehnerDo you have this error on the current dev version as well?
Comment #12
dawehnerAs that's actually a migrate/whatever issue, which can't happen on normal configuration mark it as won't fix