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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xacto’s picture

Status: Postponed (maintainer needs more info) » Active

These 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.

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Do you have configured taxonomy term fields without a selected vocabulary?

zabelc’s picture

@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.

xenyo’s picture

Status: Active » Postponed (maintainer needs more info)

I 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.

FrequenceBanane’s picture

RowboTony’s picture

subscribe

marcusx’s picture

subscribe

silkscreen’s picture

I 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.

dawehner’s picture

If 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.

silkscreen’s picture

FileSize
553.43 KB

I 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

silkscreen’s picture

In 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.

dawehner’s picture


I guess one question is where/how else would a taxonomy term field lose it's vocabulary?

It 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.

David Sparks’s picture

I 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.

dawehner’s picture

So this is a bug of taoxnomy_csv

David Sparks’s picture

Yes. How does one transfer an issue to another queue?

mikeker’s picture

Project: Views (for Drupal 7) » Taxonomy CSV import/export
Version: 7.x-3.x-dev » 7.x-5.6
Component: taxonomy data » Code
Status: Postponed (maintainer needs more info) » Active

How does one transfer an issue to another queue?

Just like this. :)

dddbbb’s picture

Any movement on this?

Gerben Zaagsma’s picture

subscribe

bigdogsam’s picture

I have the same problem, from a clean install Today.

PI_Ron’s picture

Same here.

dirkjohnson’s picture

"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.

shiva7663’s picture

Thank 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.

BeaPower’s picture

Hi I get this error when I change the machine name of an automatically created taxonomy.

Tsubo’s picture

subscribe. Same problem here....

daemonsy’s picture

Hi 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?

daemonsy’s picture

My 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

dddbbb’s picture

@daemonsy Where are your doing the deletion? Are you using a UI or are you doing it directly in the database?

daemonsy’s picture

@dixhuit

Hi, I'm deleting them under "Manage Fields" in Taxonomy. Under Structure => Taxonomy, click list terms, then the tab manage fields.

dddbbb’s picture

@daemonsy Thanks, I'll give that a go.

AlternateRoute’s picture

I 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)

Daniel_KM’s picture

Version: 7.x-5.6 » 7.x-5.7
Status: Active » Fixed

Hi,

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

daemonsy’s picture

@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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

stefgosselin’s picture

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.

stefgosselin’s picture

Status: Closed (fixed) » Active

Repoened 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.

stefgosselin’s picture

Assigned: Unassigned » stefgosselin
Status: Active » Needs review
FileSize
574 bytes

This is a patch for that clears up the notice message as I posted in comment 34 of this issue. Peer reviews welcome!

Daniel_KM’s picture

Hi,

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

Daniel_KM’s picture

Version: 7.x-5.7 » 7.x-5.10
Assigned: stefgosselin » Unassigned
Status: Needs review » Fixed

Hi,

New version of Taxonomy CSV fixes many issues with field import and probably yours.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Frank Ralf’s picture

JFTR
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.