Active
Project:
Node Connect
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2011 at 14:14 UTC
Updated:
24 Jan 2012 at 08:01 UTC
Hi everyone
Wow this is an amazing module!
would be awsome to have it integrated with the field_collection module :)
Comments
Comment #1
e2thex commented@Ciprian Oancia
Do you know what that would entail?
Comment #2
Ciprian Oancia commented@e2thex no, but it woulve fit very well for an reseller website im building.
Comment #3
chrisroditis commentedHi and thanks for the great module!
I came up into problems integrating this module with field_collection, I will try to give an short example:
Let's say we have a "field collection" field called "field_location" which consists of two normal fields "field_location_name" (a text field) and "field_location_hotels" (a multiple-value node reference field).
Now if we use nodeconnect to add hotels to the "field_location_hotels" field, two problems arise:
In "nodeconnect_add_edit_button_submit", the line $language = $form[$field]['#language']; (line 70)
gives us a warning, because field_location_hotels is not stored directly in the $form array (as $form['field_location_hotels'] ), but is instead stored in $form['field_location']['und'][0]['field_location_hotels']
The second problem that arises from this situation is in "nodeconnect_return_node_form_alter", line 160 which is the same problem as above with the language, and finally line 166, nodeconnect adds the newly created nid into $form_state['field_location_hotels']['und'][0]['nid'] but as before the actual field value is expected at $form_state['field_location']['und'][0]['field_location_hotels']['und'][0]['nid']
Any ideas how field_collection fields should be dealt with? The only clue I guess would help is checking for $form[$field]['und'][0]['#entity_type'] == 'field_collection_item' or scanning the $form tree to find $field
Comment #4
e2thex commentedOk so I think the problem here is that we should be not looking at $form[$field] but building this from the #parents tag.
That way we find the correct field to update.
@christopher_skauss do you think you could check and see if that is possible? I do not think i will have time to deep dive until late next week
Comment #5
chrisroditis commentedI've managed to bypass this with an ugly recursive array scan, but I'll try to squeeze sometime to look into #parents, sounds reasonable unless field collection did any dirty tricks with that too
Comment #6
rp7 commentedsubscribe
Comment #7
jdufaur commentedsubscribe
Comment #8
bryancasler commented@e2thex How much time investment are we taking to get this integration working?
Comment #9
dtarc commentedSee http://drupal.org/node/1217150 for a similar issue that was solved for noderefcreate.
Comment #10
bryancasler commentedNot sure if it's this simple, but in the dev release this is all the code that references "$form_state"
nodeconnect.module
Comment #11
bryancasler commenteddeleted