Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've been pouring over the CCK modules to learn how to write my own widget, and I noticed the following code in nodereference_elements()
:
...
'nodereference_select' => array(
'#input' => TRUE,
'#columns' => array('uid'), '#delta' => 0,
'#process' => array('nodereference_select_process'),
),
'nodereference_buttons' => array(
'#input' => TRUE,
'#columns' => array('uid'), '#delta' => 0,
'#process' => array('nodereference_buttons_process'),
),
...
Shouldn't "uid" be "nid"? According to nodereference_field_settings()
, the only database field defined for the field is "nid". I can only assume that Node Reference originally shared code with User Reference.
Also, I wasn't able to find much documentation on what "#columns" actually does. If the use of "uid" instead of "nid" didn't break things, does this attribute of form elements actually do anything?
Comments
Comment #1
anrikun CreditAttribution: anrikun commented+1
This issue has been posted *2 years ago* and this strange bit of code is still present in the latest 6.x-2.x-dev.
Does it mean that #columns is useless or what?
Please explain this and document #columns: