Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've been noticing repeats of the following error on a number of pages (usually node view pages):
- Notice: Undefined index: vocabulary in taxonomy_field_views_data() (line 404 of /home/user/public_html/sites/all/modules/views/modules/taxonomy.views.inc).
I'm still, trying to figure out how to duplicate this reliably, but I wanted to enter it to start the conversation in case someone else is encountering it
Comment | File | Size | Author |
---|---|---|---|
#36 | icl_content.contentype.inc-07.patch | 574 bytes | stefgosselin |
#10 | vocabulary_and_screenshots.zip | 553.43 KB | silkscreen |
Comments
Comment #1
xacto CreditAttribution: xacto commentedThese Issues have returned from a clean core and database.
I also have Ubercart installed in this build.
I had to delete the line for now. The rest of the code seems to work.
Comment #2
dawehnerDo you have configured taxonomy term fields without a selected vocabulary?
Comment #3
zabelc CreditAttribution: zabelc commented@dereine I just checked all of my taxonomy term fields (I have 7), and all of them have a selected vocabulary. Interestingly I see this message repeated 4 times on my home page and other admin pages. Also, in the views 3 Add fields dialog, only one of these term references is listed as a "Field" the others appear under "Content". I have not idea if that means anything.
Comment #4
xenyo CreditAttribution: xenyo commentedI am having the same problem with same line number. Repeated twice for me.
Gone through my taxonomy and views and dont find anything strange at the moment. Will look into it more.
Comment #5
FrequenceBanane CreditAttribution: FrequenceBanane commentedCould it be linked to #1114672: "Undefined index" after enabling Entity Tokens ?
Comment #6
RowboTony CreditAttribution: RowboTony commentedsubscribe
Comment #7
marcusx CreditAttribution: marcusx commentedsubscribe
Comment #8
silkscreen CreditAttribution: silkscreen commentedI am not a programmer, so I am not sure what the exact nature of this error.
In my case this error appeared after I exported a taxonomy vocabulary from D6 and imported it to D7. Every time I would try and edit a term from the imported vocabulary the error appeared, the error also appeared when enabling/disabling modules etc.
When I enabled forums from the core module list it added a vocabulary and an associated term, which I could edit without the error. I checked the fields in the forum vocabulary and compared them to my imported vocabulary.
The imported vocabulary had two extra fields that the forum vocabulary did not - "Synonyms" and "Related Terms" - I deleted those two fields and the error went away. Seems to be working without error now.
Since I do not need "Synonyms" and "Related Terms" on those terms for this current project I am not sure how to go about getting those associations back in correctly, I have not tried.
Maybe for others this may also be the case.
Comment #9
dawehnerIf someone could give a step by step explaination how to reproduce the problem it would be really really really wonderful.
This would be the last step before fixing the problem.
Comment #10
silkscreen CreditAttribution: silkscreen commentedI was able to reproduce the error.
Since I am learning it was helpful to try, however, I do not know how to track down the cause in code, nor how to reproduce it another way.
Hoping this is helpful to you. Views is simply amazing work guys, thank you for your continued support.
As follows. See attached screenshots.
Drupal 7 clean install
install and enable.
Ctools 7.x-1.x-dev
Views 7.x-3.x-dev
Taxonomy CSV import/export 7.x-5.6 (I encountered the error initially by importing a vocabulary - vocabulary attached)
errors in 'taxonomy.module' appear after import - cause appears to be in 'related terms' field of the imported vocabulary - where no vocabulary is selected.
note: this is confusing because when making a new field manually you are required to choose a vocabulary - hence the import.
still no 'line 404' error at this point.
install and enable 'entity api' and 'entity token'
still no error
enable 'organic groups'
error appears on modules page and after clearing cache (maybe elsewhere)
return to 'related terms' field and choose a vocabulary.
refresh
no errors
Comment #11
silkscreen CreditAttribution: silkscreen commentedIn the case I listed above.
It appears Views and Taxonomy are working correctly and the errors inform that a taxonomy term field has no vocabulary selection (a requirement for that field)?
The views that OG created when I enabled it may have triggered the error? I looked through them but could find no reference to the vocabulary in question.
After fixing the error post taxonomy import I am unable to re-create the error again, as the drop down for the 'Related Terms' vocabulary selection in that field no longer has '-Select-' (nothing selected) as a choice.
I guess one question is where/how else would a taxonomy term field lose it's vocabulary?
Not savvy enough to pursue any further.
Thanks again for Views.
Comment #12
dawehnerIt would be possible if
a) the term is not configured correctly. This could be an issue with the taxonomy import module.
b) Something deleted the vocabulary which was configured for this field.
I guess the problem is a) and so it should be fixed in the taxonomy import module.
Comment #13
David Sparks CreditAttribution: David Sparks commentedI have the same problem and think I've tracked down the cause, in my case at least.
In the taxonomy_csv module (7.x-5.6), taxonomy_csv_thesaurus_create() sets up a taxonomy_relation field for imported terms, but in the field's ['settings']['allowed_values'] array the vocabulary is stored as a vid rather than a vocabulary name.
This causes taxonomy_field_views_data() in the taxonomy module (7.0) to generate the error notice since it expects a $field['settings']['allowed_values'][0]['vocabulary'] and not a $field['settings']['allowed_values'][0]['vid'].
I'm not sure whether this field is even needed in D7 - comments in taxonomy.install suggest not. Anyway, my quick and dirty fix is to delete the field definition for taxonomy_relation from the {field_config} table, since I don't need the field.
So for me at least, the problem is caused by an incompatibility between taxonomy 7.0 and taxonomy_csv 7.x-5.6.
Comment #14
dawehnerSo this is a bug of taoxnomy_csv
Comment #15
David Sparks CreditAttribution: David Sparks commentedYes. How does one transfer an issue to another queue?
Comment #16
mikeker CreditAttribution: mikeker commentedJust like this. :)
Comment #17
dddbbb CreditAttribution: dddbbb commentedAny movement on this?
Comment #18
Gerben Zaagsma CreditAttribution: Gerben Zaagsma commentedsubscribe
Comment #19
bigdogsam CreditAttribution: bigdogsam commentedI have the same problem, from a clean install Today.
Comment #20
PI_Ron CreditAttribution: PI_Ron commentedSame here.
Comment #21
dirkjohnson CreditAttribution: dirkjohnson commented"Undefined index: vocabulary in taxonomy_field_views_data() (line 415 of ... sites/all/modules/views/modules/taxonomy.views.inc)" (Views 7.x-3.0-rc1)
I don't know whether this is relevant for sure, since I didn't install taxonomy_csv and it's line 414 in my error, not 404, but I'm adding it in case it helps someone who knows a lot more than I do by supplying a different dimension and possible crossover point with the line 404 error.
The "notice" showed up for me after enabling Migrate Example 7.x-2.1. After deleting the vocabularies and content types created by Migrate Example, the message no longer appears.
Apologies in advance if this is completely irrelevant to the case.
Comment #22
shiva7663 CreditAttribution: shiva7663 commentedThank you! Deleting the vocabularies and content types created by Migrate Example fixed my problem with this issue. So, it sounds like there are multiple ways for this to happen. heh.
Comment #23
BeaPower CreditAttribution: BeaPower commentedHi I get this error when I change the machine name of an automatically created taxonomy.
Comment #24
Tsubo CreditAttribution: Tsubo commentedsubscribe. Same problem here....
Comment #25
daemonsy CreditAttribution: daemonsy commentedHi guys,
When I used Taxonomy export/import, at both the export and import process, I chose Full Terms and Definitions.
My Vocabulary is very simple, just name and descriptions. I realized after the import, there are extra fields such as Related Terms and Synonyms.
I deleted ALL the extra fields from all imported vocab and the error messages stopped. Could the problem be caused by these extra fields?
Comment #26
daemonsy CreditAttribution: daemonsy commentedMy setup:
All Dev versions are downloaded as of 31st August.
Drupal Core 7.7
Views Dev
CTools Dev
Taxonomy 7.x-5.6 (currently disabled after importing)
Content Taxonomy Dev
Taxonomy Manager Dev
Term Level Fields
Comment #27
dddbbb CreditAttribution: dddbbb commented@daemonsy Where are your doing the deletion? Are you using a UI or are you doing it directly in the database?
Comment #28
daemonsy CreditAttribution: daemonsy commented@dixhuit
Hi, I'm deleting them under "Manage Fields" in Taxonomy. Under Structure => Taxonomy, click list terms, then the tab manage fields.
Comment #29
dddbbb CreditAttribution: dddbbb commented@daemonsy Thanks, I'll give that a go.
Comment #30
AlternateRoute CreditAttribution: AlternateRoute commentedI deleted the two fields for related terms and synonyms for each of my vocabularies (they were all imported ) and I haven't had the problem again. (Yet)
Comment #31
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
The new 7.x-5.7 release fixes a lot of fields issues.
@daemonsy: Import with "Full terms definitions and links" automatically creates a full vocabulary, similar to Drupal 6 ones. The use of a format implies the creation of an adapted vocabulary, even if some fields are not used. Formats that are not designed to import synonyms or related terms don't create such a fields. Anyway, unused fields can be easily removed, as you say, under "Manage Fields" in Structure > Taxonomy > Edit vocabulary > Manage fields.
At others people, could you retry with the new release? Thanks.
For more discussion on fields issues, see #1027068: Taxonomy CSV: Fields Support.
Sincerely,
Daniel Berthereau
Infodoc, Digital humanities & Knowledge management
Comment #32
daemonsy CreditAttribution: daemonsy commented@Daniel_KM Thanks for the explanation and the new release! Actually I didn't really catch what you meant fully, a bit noob =P. I think that's what I happened to do and the problem was gone.
Comment #34
stefgosselin CreditAttribution: stefgosselin commentedNotice: Undefined index: taxonomy_term in field_views_field_default_views_data() (line 222 of C:\dev\cnhq\public_html\sites\all\modules\contrib\views\modules\field.views.inc). Not sure if this is related to this issue. I have not installed migration examples. The only thing I can think of that could help reproducing this is I may of changed the name of the vocabulary along the way.
Comment #35
stefgosselin CreditAttribution: stefgosselin commentedRepoened this issue as I have a feeling it is related to the one posted below:
Notice: Undefined index: taxonomy_term in field_views_field_default_views_data() (line 222 of C:\dev\cnhq\public_html\sites\all\modules\contrib\views\modules\field.views.inc). Not sure if this is related to this issue. I have not installed migration examples. The only thing I can think of that could help reproducing this is I may of changed the name of the vocabulary along the way.
Comment #36
stefgosselin CreditAttribution: stefgosselin commentedThis is a patch for that clears up the notice message as I posted in comment 34 of this issue. Peer reviews welcome!
Comment #37
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
Thanks for your patch. Unfortunately, I can't reproduce your issue and the patch is not for this module. I look forward.
Sincerely,
Daniel Berthereau
Infodoc, Digital humanities & Knowledge management
Comment #38
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
New version of Taxonomy CSV fixes many issues with field import and probably yours.
Sincerely,
Daniel Berthereau
Infodoc & Knowledge management
Comment #40
Frank Ralf CreditAttribution: Frank Ralf commentedJFTR
I got the same errors with a fresh install of Drupal 7.21 without Taxonomy CSV import/export module so the error doesn't seem to be related to this module (alone).
#1114672: "Undefined index" after enabling Entity Tokens (mentioned in #5) seems a more likely culprit.