Hi,

I use field_collection_table. On my field_collection there is required fields, and my field_collection is multiple.
When I click on "add another item", if there is a validation error this error is displayed:

Notice : Undefined index: #entity_type dans field_collection_table_pre_render_field() (ligne 224 dans D:\svn\ocre_dev\sites\all\modules\contributed\field_collection_table\field_collection_table.module).
Notice : Undefined index: #bundle dans field_collection_table_pre_render_field() (ligne 224 dans D:\svn\ocre_dev\sites\all\modules\contributed\field_collection_table\field_collection_table.module).
Notice : Undefined variable: header dans theme_field_collection_table_multiple_value_fields() (ligne 133 dans D:\svn\ocre_dev\sites\all\modules\contributed\field_collection_table\theme\theme.inc).

And the table header disappear...

On the field_collection_table_pre_render_field function, the variable $element contains :

$element = ( 
0 (Array, 2 elements)
    #prefix (String, 30 characters ) <div class="ajax-new-content">
    #suffix (String, 6 characters ) </div>
 1 (Array, 37 elements)
    #entity_type (String, 21 characters ) field_collection_item
    #entity (Object) FieldCollectionItemEntity 
    ....
    ....
)

$element[0] contains a bad value but I don't know resolve this, can you help me please ?

Thanks

(ps sorry for my bad English)

Comments

Roulion’s picture

Same here, the issue appears with trhe last entity-API dev version for me

i also have the message
Undefined index: #entity_type dans field_collection_table_pre_render_field() (ligne 219 dans sites/all/modules/field_collection_table/field_collection_table.module).

mstrelan’s picture

itangalo’s picture

attiks’s picture

Status: Active » Needs review
StatusFileSize
new1.55 KB

I had my table header disappearing when I added a new row, without filling in the first one.

Sometimes the row with $key == 0 didn't had any children, so the headers didn't get set.

rooby’s picture

The patch in #4 didn't apply to latest dev.

Here is a re-roll.

It fixes the crazy headers when you use the add another item button.

rooby’s picture

Also, the table headers were disappearing on clicking the add another button.

[EDIT] actually I think that was causing a different error, which was causing this one.

Steff Vanhaverbeke’s picture

Same issue here. Table headers disappear when clicking 'add another'.

Also, I have 'entity reference' fields in the table, that loose their autofill functionality.

robcarr’s picture

The patch addresses the headers on the table... so from my perspective the patch at #5 works. RTBC?

But I'm seeing the same problem as Stephan at #7: as soon as 'add another' is clicked, all the entity references lose their populated values (in the existing rows), and there are no values in the select list [the entity reference titles built from a view]. Probably a separate, but related issue.

No entirely sure if this problem is also related to #1815496: Using "Hide blank items" leads to misformed tables

-----------
EDIT - Sorry, clicked wrong button earlier

lpalgarvio’s picture

worked for me!

Field Collection 7.x-1.0-beta5
Field Collection Table 7.x-1.0-beta1

Please commit!

lpalgarvio’s picture

Status: Needs review » Reviewed & tested by the community
Morasta’s picture

#5 solved my problem with table table headers disappearing on the node edit form. No other side effects found.

maximpodorov’s picture

@kevineinarsson, is this issue fixed by the recent commits?

kevineinarsson’s picture

Status: Reviewed & tested by the community » Fixed

Seems to be fixed with the patch in #2104475.

Status: Fixed » Closed (fixed)

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