Field collection is a module that provides a field-collection field to which any number of fields can be attached.

learn more… | top users | synonyms

0
votes
1answer
16 views

Create a field collection field programmatically

Is there a way to create a field collection programmatically? I saw this code: $field_collection_item = entity_create('field_collection_item', array('field_name' =>'field_text')); // Create new ...
0
votes
0answers
16 views

Hierarchical select with filed collections previously selected item gets selected [closed]

Hierarchical select with field collections previously selected item gets selected in the add another item. Steps followed: Added Hierarchical select module in field collections add another item. ...
0
votes
1answer
12 views

How do i add addmore button for fields in webforms

clicking on ADD the functionality is done in drupal-6 using webform and webform add more modules. I am trying this in Drupal-7 ,but unable to achieve above functionality. I am using webform modules ...
0
votes
1answer
6 views

How to diagnose an undefined index in a fresh install of Drupal 7?

Question: How do I begin to explore what is causing this error? If this were reporting errors from a contrib module, I would submit a bug report on drupal.org. However, I'm not really sure where I ...
2
votes
1answer
35 views

How to implement Asset Inventory?

I would like to create an Asset Management Inventory for our corporate helpdesk. There is a list of assets (laptop, phones etc) which our ICT staff members can borrow from the helpdesk. Members would ...
1
vote
1answer
20 views

field_collection_item not updating / old data preserved

I am using SalesForce suite to pull data from SalesForce to Drupal. In the SalesForce object I have multiple date fields. These fields needs to map to a field-collection in the node. The field-...
0
votes
2answers
22 views

Import excel in field collection items

I m using field collection items in my content type for particular upload function. I want to use import excel feature to bulk upload with field collection item fields. when i click on import excel ...
0
votes
1answer
14 views

Setting #states property for a field_collection item added with the add_more button

This is a D8 question as the solution in Using #states with field collection doesn't work for D8. Here are the solutions I have tried, but none of them was working: 1- Adding an after build function ...
0
votes
0answers
16 views

PHP rewrite on field-collection with onclick function

I'm trying to rewrite field-collection [field_video_cue_points] items as a link which hold onclick javascript functions in Views. I use the links to jump to specific times within a video. A link looks ...
1
vote
0answers
11 views

Drupal field collection error

I tried using Drupal field collection module. I am getting the following error when I try to save the content using this field collection. I tried searching for anything related but couldn't find any ...
1
vote
0answers
12 views

simple fb connect enter custom user field in field group for new users

I need a help with an issue that I am facing in the module. So, on my registration page I have some extra fields like: Country Real name (different from username) Country and real name value is ...
0
votes
2answers
30 views

Field widget value not able to save via ajax

I am trying to create a custom field type widget with a ajax submit handler to save the value of the field to the database without saving the whole node. Here is my code hook_field_field_info(). ...
1
vote
0answers
43 views

Twig field collection theme get field id

I am trying to get the field ID of of a field collection item being rendered in a field collection theme twig file: field-collection-item--field-name.html.twig. I am able to render content using {{...
1
vote
0answers
15 views

How do I store data in entities text-list and field-collections?

I have retrieved data from an external database using REST. Now that it is cached in my Drupal 7 site in tables, I need to create new nodes of a specific content type. Works fine for most fields (e.g.,...
0
votes
0answers
10 views

Skip save of field collection attached to entity without removing reference to field collection?

I've got a node form encumbered with many field collections and node save takes forever. I would like to "lock" some of those field collections and forgo saving them on node save. Kind of like ...
1
vote
1answer
19 views

Using Features to create module with nested field collections

I'm using Fred Parke's method to create a content type module by first building the content type and then turning it into a feature and exporting it. It works perfectly well, except for when I include ...
2
votes
0answers
64 views

How to properly programmatically add field collections to an entity in drupal 8?

What is the proper way to programmatically add a field collection to an entity in Drupal 8? I can't find this online. This is what I'm using and it seems to work. The tricky part is setting the ...
0
votes
0answers
16 views

Replace field collection by a field that can handle multiple references values

I need to improve my current usage of field collection. See attached image. I have a content type A, which has Field Collections (FieldCollection A1). In each FieldCollection Ax, there are several ...
3
votes
3answers
43 views

Can I add a field collection to a block?

I have made a field collection, exported as a Feature and now I'd like to add it to a block. Does anyone have any suggestions? I have added fields to blocks through the form API, but that doesn't ...
1
vote
1answer
226 views

Drupal 8 : Render a field collection item in a Twig template

In Drupal 8, I have a content type which use Field Collection Module like that : field_body (FieldCollection, repeatable) field_image_alignment(Boolean) field_picture (Image) field_free_text (Long ...
1
vote
1answer
87 views

Display field collection items by using twig

I'm using the field collection module in Drupal 8 to encapsulate event informations so I've got a field collection with six sub fields (place, starting time, etc.). In my twig template field--field-...
0
votes
0answers
40 views

How to programmatically render a field collection in Drupal 8?

For "normal" fields, this works: $node = \Drupal::routeMatch()->getParameter('node'); $field = $node->field_foobar->value; print render($field); But if the field is a field collection, it ...
1
vote
1answer
19 views

SQLSTATE[42000]: Syntax error or access violation in drupal views query [closed]

When trying to preview a view containing references to three Field Collection module fields, I get the following error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in ...
0
votes
1answer
29 views

Invalid datetime format for a field never submitted?

I'm working my the edit page for my mobile app which is fetching data from a Drupal site. I'm fetching data, I'm editing it, and submitting it. However, when submitting back, I'm getting Internal ...
1
vote
2answers
50 views

Restrict “add more” button to add new fieldset after adding 5 fieldsets

I have taken a field of type field collection in my user-profile-form and its cardinality is set to unlimited as I wanted to have "add more" button for the users. I want to restrict the addition of ...
1
vote
0answers
14 views

Field Collections Arrays

I have done my due diligence, but can't find an answer anywhere. I am trying to pop an array in a field collection and then implode it. Here is my code, which is not working. Also, I am not sure if ...
2
votes
1answer
27 views

How to get the data of field collections

I have one field collection with 4 fields. How to get the data of field collection in views tpl file I am trying to load data as field_collection = entity_load('field_collection_item', array($node-...
0
votes
1answer
10 views

Add more fieldset with remove option custom module

I'm developing custom module and there's one fieldset that can be added multiple times and can be removed any particular entry also. Can anyone please suggest to achieve this? Here is my code: ...
0
votes
0answers
10 views

Drupal File Collection module has widget that's not 508 Compliant

So I am using the Field Collection module in Drupal 7 and I have a field in a content type that is of type Field Collection and the widget is Embedded. Now my site has to be 508 Compliant, I am ...
0
votes
1answer
21 views

Setting a field collection default value for a field using form

I'm trying to set up a default value programmatically to my field which is in field collection. This has proved quite hard and I cant seem to get around it. Any assistance will be appreciated. This is ...
1
vote
1answer
37 views

How to submit a field collection from a form into a created node

I would really appreciate if somebody could help me with this :) I have a field collection called field_formations. Inside it I have 2 fields: field_technologies - (reference to a taxonomy). ...
1
vote
0answers
13 views

calculate nested field collection with computed field

I have this complex collection field in content type collection field "parent" - computed field "a" (sum all computed field "b" listed in collection field "a") - collection field "a" (unlimited ...
1
vote
1answer
35 views

field collection - taxonomy term can't display

I used taxonomy term with field collection and taxonomy term can't display look this video https://www.youtube.com/watch?v=cEI1yDcJXT4
1
vote
0answers
19 views

field collection - taxonomy terms [duplicate]

I used taxonomy term field with field collection and taxonomy term id not attached on node id. taxonomy term cannot get result. look video! used D8 but in D7 have the same problem. the same problem ...
0
votes
1answer
25 views

ajax_command_invoke adding a new item in a field collection

I'm using the field_collection module. A collection has a "custom field" I've created, which rely on a jQuery plugin. When I add another item in my collection, the jQuery plugin is no more invoked, ...
3
votes
1answer
108 views

How to save custom commerce_profile_reference field widget data

Description: My drupal commerce line-item's have extra "add-to-cart form" fields attached to the line-item type. One of the fields is a field-collection that contains 2 fields: A ...
1
vote
1answer
130 views

How to store values to field collection or paragraphs programmatically?

How do I store values to either a field collection or a paragraphs field programmatically? Could somebody please provide a working code example of how you do this? I would have a field holder ...
0
votes
0answers
22 views

How do I change field handler_settings within hook_form_alter?

I have an entity reference field that is inside of a field_collection (D8) and I need to alter it's views arguments during ajax load to pass in the value from a preceding field on the host entity. I ...
0
votes
1answer
21 views

Update existing field collections with Migrate module

How can I update existing field collection entities using Migrate module? I wasn't able to find any examples at the official documentation page, nor anywhere else. When I'm migrating nodes, I can do ...
1
vote
1answer
29 views

Let the user choose the field type

I'm working on a drupal project and part of it is a sort of "tile overview" page. Its a 3x? grid, with a variable length. |--|--|--| |--|--|--| |--|--|--| |--|--|--| .. .. .. Sort of like that, I ...
1
vote
1answer
69 views

How to create a confirm popup when delete item with field collection?

I have configured a field collection field (unlimited items) for a content type and I want create a confirm popup when user delete an item. For this, i found that i can directly go and modify 2 ...
1
vote
0answers
30 views

Get value from field outside field collection

I have the following setup: Field price (boolean) Field collection Field amount (decimal) Field total (computed) How can I load the "price" field inside the "total" computed field to calculate ...
0
votes
1answer
19 views

Avoid duplicate ID for a field that appears multiple times on the same form

I'm having a problem with duplicate ID's for a custom field widget. The scenario: I have an order form, that contains 2 field collections "pick-up" & "delivery". Both these collections contain ...
0
votes
2answers
23 views

Cannot use fields as product attributes if they are within a field collection

I am building a commerce marketplace, and have several field that I am reusing on multiple product types. It's getting tedious adding them over and over, so I'd like to include them in a field ...
0
votes
0answers
10 views

How to create a view that displays all entities linking to current entity when using field collections

I am trying to create a view that displays all nodes of type A that reference the currently viewed node (node of type B). The reference is made through a field collection field. Below is a schematic ...
0
votes
1answer
31 views

hook_node_update hitting a wall with a loop I created

I have a taxonomy multi-select list that is used to create/delete entries in a field collection in my node. I'm trying to make it so that if the user deselects an item from the taxonomy list, the ...
0
votes
0answers
27 views

How to programmatically add 2 field collection items to a node in node_presave

One of my content types has a field collection field, that field collection has one link field in it. Each node needs two instances of that field collection field, and I need to be able to add them in ...
0
votes
3answers
671 views

Extracting the values of Field Collection

I have created a foreach loop in my node template in Drupal 8 where values of the field collection are being printed as 1 and 2. Instead I want the content of the field collection which includes an ...
0
votes
1answer
18 views

How to fix field collection ajax #edit-submit clash with node #edit-submit?

I have Drupal 7.41, field_collection 7.x-1.0-beta10+1-dev, and field_collection_ajax 7.x-1.x-dev I am the admin of a site where we have a disease content type, and a part of each disease node is its ...
1
vote
0answers
14 views

Migrate FieldCollection with host entity FieldCollection

in our Drupal application, we have a few field collections that themselves have field collections. It looks like this: field_collection1 ├── field_xyz ├── field_collection2 └── field_collection3 ...