Adeel Nawaz
Adeel Nawaz

Reputation: 121

how to create view of field collection in drupal 7

when i am creating a view of field collection they give error when we add fields in view error is that:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /en/admin/structure/views/view/new_page/preview/page/ajax StatusText: error ResponseText: Exception: Invalid field name given: field_translations is not a Field Collection field. in FieldCollectionItemEntity->__construct() (line 210 of /home)

how handle this problem

Upvotes: 2

Views: 398

Answers (2)

cptstarling
cptstarling

Reputation: 779

Check if the field field_translations still exists as a field collection field on your installation (probably not anymore). Apparently removed fields remain inside the database table of Field Collection.

To solve this:

  1. Take a database backup of your current installation (just to make sure)
  2. go to your database, find the table field_collection_item and explore it
  3. find all the items referencing to field mentionned in the error (in this case this would be field_translations)
  4. Remove all these items and clear the cache of your Drupal installation

(Source)

Upvotes: 0

Tomáš Fejfar
Tomáš Fejfar

Reputation: 11217

To create field collection view you need to add relationship to the Field collection first and than you can use it. The above error seems like you're using a wrong field.

Upvotes: 0

Related Questions