It will add the select box, but will not populate it within a flexifield. Anyone come across this issue?

Thanks

Comments

JoeMcGuire’s picture

Status: Active » Postponed (maintainer needs more info)

Is the issue with the Link field or the Node Reference field?

gerhard killesreiter’s picture

it happens when you have a nodereference field inside a node in a flexifield. The view to populate the selector is simply not called.

gerhard killesreiter’s picture

However it works with autocompletion fields so there is a workaround.

gerhard killesreiter’s picture

Title: Node Reference broken when used with flexifield » Node Reference broken when used with flexifield and selector
Project: Link » Content Construction Kit (CCK)
Version: 6.x-2.5 » 6.x-2.1
Component: Code » nodereference.module
Status: Postponed (maintainer needs more info) » Active

Moving to corrct place, changing title.

gerhard killesreiter’s picture

Project: Content Construction Kit (CCK) » Flexifield
Version: 6.x-2.1 » 6.x-1.x-dev
Component: nodereference.module » Code

Actually, this is probably more of a flexifield issue.

gerhard killesreiter’s picture

It appears that this is so because $form['#field_info'][$field_name] is not set inside the process function. flexifield tris to do something about it in flexifield_setup_form_field_info_hack but that does not appear to work.

gerhard killesreiter’s picture

I've investigated this some more and I think the probkem is due to the fact that the nodereference field re-.uses the fields created the fields from the optionswidget module in its process function. This leads to the optionswidgets process function being called although not defined in the form and thus the tricks devised by the flexifield author don't work.

effulgentsia’s picture

Status: Active » Fixed

This is now fixed in 6.x-1.x-dev (you can grab it from cvs or you may need to wait 12 hours for the tarball to be regenerated). I will release a 6.x-1.0-alpha2 version by March 4, 2009 that will also contain this fix.

gerhard killesreiter’s picture

Status: Fixed » Active

I believe this fix relies on a patch to form.inc, namely that you pass $complete_form by reference into form_builder_handle_input_element, is this correct?

effulgentsia’s picture

Status: Active » Fixed

Nope. The fix works without any patches to drupal core or to cck. I'm hooking into the #process array of the specific element, where I'm inserting a function that takes the form by reference and is able to add '#field_info' to it in a way that sticks when the element's normal #process function is called. A lot more code than if form_builder_handle_input_element() took $complete_form by reference, but it does work with a clean drupal install.

effulgentsia’s picture

Version: 6.x-1.x-dev » 6.x-1.0-alpha2

Alpha2 is released!

Status: Fixed » Closed (fixed)

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