how to create view of field collection in drupal 7

407 Views Asked by At

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

2

There are 2 best solutions below

0
On

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)

0
On

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.