Needs work
Project:
Field collection
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Aug 2012 at 05:49 UTC
Updated:
17 Jun 2020 at 17:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
idflood commentedComment #2
idflood commentedFound one more issue at the same spot if the field processed is a "container". Here is the notice displayed:
Notice : Undefined offset: 0 dans field_collection_field_attach_form() (ligne 1143 dans .../sites/all/modules/field_collection/field_collection.module).In this situation the $lang variable is set to FALSE so I added it to the condition.
Comment #3
gmclelland commented#2: undefined_langcode-1716526-2.patch queued for re-testing.
Comment #6
gmclelland commentedI'm seeing this as well. In my case, I think it is when I'm using http://drupal.org/project/fape to edit a field that is attached to a node.
Can you re-roll your patch?
Comment #7
jelle_sAlso, there should be a check if the field exists in the form, developers can call field_attach_form with a value for 'field_name' in the options argument, if so it is possible that a field is not present:
Comment #8
super_romeo commented#7 - same thing
Comment #9
kle commented#7 - same issue
Solution is simple: Change this in field_collection_field_attach_form():
to
Comment #10
barry_fisher commentedThanks kle
Following on from #9 I've rolled a patch adding the
&& isset($form[$field_name]against 7.x-1.0-beta8 which works for me.Comment #11
chris burge commented#10 resolved the issue for me. In my case, the field didn't exist, which caused the error.
Comment #12
japerryThe patch in #10 doesn't fully get all the if statements. This following patch adds checks at the top of the loop, which skips looking in the field if none of the conditions are met.
Comment #13
shi99 commentedThe patch in #12 solved the issue for me.
Thanks
Comment #14
ybabel commentedPatch #12 works fine but do not apply any more (the lines have changed position 1009 -> 1226)
Comment #15
japerryHere is a re-roll against HEAD as of 2/2/2017. It also works against beta12.
Comment #16
tobiberlinI applied that patch against 7.x-1.0-beta12 version and it works like a charme
Comment #17
tobiberlinUnfortunately I found out that it does not solve the issue. I create a form in the following way:
It seems that field_collection_field_attach_form() still acts on fields and field collections which should never be added to the form. After applying the patch following error messages appear:
They repeat in different order. The node type I want to get the fields from, has some field groups/ collections and fields in it.
Comment #18
tobiberlinI found out the problem was in another hook_field_attach_form: https://www.drupal.org/node/2890683
Comment #19
chris burge commentedPatch no longer applies to HEAD.
Comment #20
ericpoir commentedI created undefined_langcode-1716526-20.patch to make it work with the current version of the module.