This patch lets CCK support term.module fields in nodes. See #491190: Provide a taxonomy term field type for that patch.

(I don't expect this to be committed necessarily, but I do want to make the patch available for others to test with.)

CommentFileSizeAuthor
#6 cck-term-field-support.patch1.78 KBAnonymous (not verified)
#3 cck-term-field-support.patch1.82 KBAnonymous (not verified)
#2 cck-term-field-support.patch2.13 KBAnonymous (not verified)
cck-term-field-support.patch1.8 KBAnonymous (not verified)

Comments

Anonymous’s picture

Anonymous’s picture

Title: CCK Field UI support for term.module fields » CCK Field UI support for vocabularies as lists
StatusFileSize
new2.13 KB

DO NOT USE THIS PATCH. Use the original one attached to this issue.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new1.82 KB

This patch adds support to CCK Field UI for taxonomy term fields. A field's allowed values can be the terms in a single vocabulary or the combination of multiple vocabularies.

yched’s picture

Thanks bangpound.
To all, note that we need #488542: Tie Field UI pages to any fieldable entity in to make CCK HEAD UI available on taxo terms.

+  $widget_type = $instance['widget']['type'];
+  $field_type = $field['type'];
+  $label = $instance['label'];

Those variables don't seem to be used anywhere ?

+  // Get the right values for allowed_values_function, which is a core setting.
+  $defaults = field_info_field_settings($field['type']);
+  $settings = array_merge($defaults, $field['settings']);

Shouldn't be needed when #509736: Make sure all settings are present at run time gets in. I think it's safe to remove now, we don't want field-type modules code to be littered with "if(!isset($settings['foo']))" or "merge in default settings"...

That's more a question for #491190: Provide a taxonomy term field type, but I'm not sure having a taxo field span over several vocabs is a good idea. [edit: besides, this patch mentions $settings['vid'] (singular)]

Anonymous’s picture

Eek! Thanks for checking this out yched. I thought I had caught all the $settings['vid'] strings that hadn't been changed to arrays. I'll chase these down today.

Anonymous’s picture

Title: CCK Field UI support for vocabularies as lists » CCK Field UI support for term fields
StatusFileSize
new1.78 KB

Here's a new patch.

The 'parent' setting is forced to 0 for now. That's the essential functionality but not the full range of possibility.

yched’s picture

Status: Needs review » Active

Committed so that people can more easily test #491190: Provide a taxonomy term field type. Thanks bangpound !

Note: this form lets you change existing entries in $field['settings']['allowed_values'], but not remove them or or add a new one...
Might be a little tricky :-(

Thus, leaving 'active' for now.

Anonymous’s picture

Thanks yched. I'll post a new patch after #491190: Provide a taxonomy term field type lands. The goal of this patch was to let users configure a field for one vocabulary without destroying settings that may have been created otherwise... though I'll admit, it has not been rigorously tested for those stranger cases yet.

karens’s picture

Status: Active » Fixed

Both the UI and taxonomy fields are now in core, so this doesn't apply any more.

Status: Fixed » Closed (fixed)

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