Opening this up as a followup from #491190: Provide a taxonomy term field type - see discussion in the issue. Obviously this lets us do tags as fields, but it'd also be useful for things like #526120: Remove related terms from core now that terms can have a term reference field.

CommentFileSizeAuthor
#36 autocomplete.png5.58 KBcatch
#34 taxonomy-autocomplete_526122_34.patch12.56 KBAnonymous (not verified)
#30 taxonomy-autocomplete_526122_30.patch11.51 KBAnonymous (not verified)
#26 taxonomy-autocomplete_526122_26.patch11.72 KBAnonymous (not verified)
#25 taxonomy-autocomplete_526122_25.patch11.87 KBAnonymous (not verified)
#23 taxonomy-autocomplete_526122_23.patch12.16 KBAnonymous (not verified)
#13 taxonomy-autocomplete_526122_13.patch13.05 KBAnonymous (not verified)
#7 options-autocomplete_526122_7.patch12.08 KBAnonymous (not verified)
#6 options-autocomplete_526122_6.patch9.07 KBAnonymous (not verified)

Comments

Anonymous’s picture

While the motivation for this widget is to support tagging vocabulary widgets, there's no reason why the widget should be constrained to term fields. It should be able to work for term and list fields. Adding a new term should be a feature the widget provides for term fields, and it should be optional there too.

catch’s picture

Having it as an option would also possible support #340652: Edit/delete terms permission per vocabulary.

catch’s picture

Issue tags: +Performance

Tagging with performance - we currently load the entire taxonomy tree when editing terms, which can bring sites with large vocabularies to a halt (apart from the hidden variable that lets you override this we put into D6, but that's a hack borne out of desperation at the end of the D6 release cycle). Autocomplete + related terms as fields gives us a scalable option for that stuff without having to cram it into taxonomy.module itself.

yched’s picture

"It should be able to work for term and list fields"
I'd even say it would make sense for regular text fields as well... Even though those don't have a closed list of 'allowed' values, you might still want to get feedback about existing values...

catch’s picture

And another module becomes completely obsolete: http://drupal.org/project/textfield_autocomplete

Anonymous’s picture

Assigned: Unassigned »
Status: Active » Needs work
StatusFileSize
new9.07 KB

THIS is the WORST patch you've ever seen. It throws all kinds of warnings. It's so obviously a big giant hack. And it's not even done.

BUT it's already less of a hack than current taxonomy form tag processing.

You can use existing terms but not create new ones. Change values, save, and it's all good.

I'm happy to talk about the patch in IRC...

Anonymous’s picture

StatusFileSize
new12.08 KB

Here we go. This patch now covers most of the bases required for this feature. Terms are searched and terms can be added when they don't exist.

There are still some TODOs.

This needs review from Field API experts. I've inserted comment blocks at the relevant places to indicate where I think Field API needs to support some abstraction if we're going to make autocomplete fields into a reusable widget.

Anonymous’s picture

Status: Needs work » Needs review
catch’s picture

OK I took a look at this, but I'm not much up on widgets and formatters.

IMO, those notes should just be issues + TODOs in the code, then let's do some minor tidy up and get this in asap. If yched is able to help clean up then great, but we don't have long to go now. Additionally, I'd be happy to remove synonym collapsing (which isn't as full featured as the D6 module anyway) in favour of fixing up the rest of taxonomy.module - if synonyms become a text field, it's going to be even more complex. One idea I had with synonyms before the original patch went in, was to only query for synonyms for autocomplete if there's no matches for real terms - so an extra query if (empty($matches)) rather than a join. Any use?

yched’s picture

+++ modules/field/modules/options/options.module	9 Aug 2009 16:29:06 -0000
@@ -92,6 +116,11 @@ function options_elements() {
       ),
+    'options_autocomplete' => array(
+      '#input' => TRUE,
+      '#columns' => array('value'), '#delta' => 0,
+      '#process' => array('options_autocomplete_elements_process'),
+    ),
     );

Indentation is wrong

+++ modules/field/modules/options/options.module	9 Aug 2009 16:29:06 -0000
@@ -103,6 +132,7 @@ function options_field_widget(&$form, &$
+  // TODO: autocomplete textfield needs to do something here.

not sure what you mean

+++ modules/field/modules/options/options.module	9 Aug 2009 16:29:06 -0000
@@ -255,6 +285,131 @@ function options_autocomplete_elements_process(
+    foreach ($element['#default_value'] as $item) {
+      // TODO: do i need to load the term? when is the term not available?
+      $tags[$item['value']] = isset($item['taxonomy_term']) ? $item['taxonomy_term'] : taxonomy_term_load($item['value']);
+    }
+    $element['#value'] = taxonomy_implode_tags($tags);

also only works for taxonomy
+ I don't think the load is needed. The items here come from a field_attach_load(), so the full terms should be loaded, right ?

+++ modules/field/modules/options/options.module	9 Aug 2009 16:29:06 -0000
@@ -255,6 +285,131 @@ function options_autocomplete_elements_process(
+  $element[$field_key]['#maxlength'] = !empty($field['settings']['max_length']) ? $field['settings']['max_length'] : NULL;

not needed, I think, this is for text fields

+++ modules/field/modules/options/options.module	9 Aug 2009 16:29:06 -0000
@@ -255,6 +285,131 @@ function options_autocomplete_elements_process(
+// Set #element_validate in a way that it will not wipe out other
+  // validation functions already set by other modules.

indentation

+++ modules/field/modules/options/options.module	9 Aug 2009 16:29:06 -0000
@@ -255,6 +285,131 @@ function options_autocomplete_elements_process(
+    /**
+     * @todo Use the same module or API hook required for autocomplete, which
+     * must also support multiple values so validation, transformation can be
+     * quick.
+     * @see options_autocomplete
+     */

Hm, not easy indeed.
Well, maybe there's a clever way to do this, but I don't see it right now. IMO it's perfectly OK to forget about abstracting to 'list' fields as well, and provide an autocomplete widget just for term fields.
If list fields want an autocomplete, at best we can figure a clever way to merge this back into a single widget within code freeze (/me is dubious), at worst list.module or a contrib module will provide a dedicated widget for list fields, no big deal. Sorry for the suggestion (er - actually no, it was your idea initially ;-), I "merely" suggested we extend it to regular text fields as well. Anyway)

20 days to code freeze. Better review yourself.

yched’s picture

Also :

+++ modules/field/modules/options/options.pages.inc	9 Aug 2009 16:29:06 -0000
@@ -0,0 +1,88 @@
+  $instance = field_read_instance($field_name, $bundle);
+  $field = field_read_field($field_name);

Use field_info_field() and field_info_instance() instead. Those are the cached, updated to for current execution context, versions. field_read_*() cause a db hit each + some array massaging. Making the distinction cleaner in PHPdocs is on my personal TODO after #367753: Bulk deletion lands.

Beer-o-mania starts in 20 days! Don't drink and patch.

Anonymous’s picture

Thanks for the careful reviews. I'll post a new patch shortly. Before I do, I need to mention a few things:

  1. The code style errors (indentation) yched mentions are in HEAD. I'm no longer going to patch options.module, so these are still problems for someone to deal with.
  2. We have drupal_explode_tags but no drupal_implode_tags. Instead we have taxonomy_implode_tags, which is a muddle of validation and "field" specific code now. It won't need to be this in Drupal 7, because it will always be getting terms (a.k.a. field instance values) from the "right" vocabulary. The values will already have passed validation in the original submit OR taxonomy_field_load will weed them out before presenting them to the user again. Anyone doing this kind of autocomplete field needs the same sturdy function. Can we rename it to drupal_implode_tags, remove the taxonomy term specific code, and move it to common.inc?

Everything else is loud, clear and straightforward. Thanks for your review. Check back soon.

Anonymous’s picture

StatusFileSize
new13.05 KB

This patch works. I came up against some problems that I need advice on.

Previewing nodes meant the formatters received just the field values (term IDs) and not the whole term object. I loaded these in the element's validate function. Is that the right thing to do?

The function taxonomy_autocomplete will cause the tests to fail because the function signature has changed. Should I duplicate the function for now and rename the function in a later patch after the original taxonomy_autocomplete is gone? (Or what?)

There are still some todos related to subtrees.

New terms can only be added to one 'tree' in the settings of the field, but the settings can include multiple trees. Currently new terms are added to the first tree, but I'd like it to be configurable. Is this a field setting or an instance setting?

Right now there's no validation of subtrees of a vocabulary. Only the vid is checked.

yched’s picture

Previewing nodes meant the formatters received just the field values (term IDs) and not the whole term object. I loaded these in the element's validate function. Is that the right thing to do?

Good call, previewed values don't come from field_attach_load(). Bummer.
Loading those in a validate function sounds like a hack. All 'term field' widgets will have the same issue, BTW, not only the autocomplete one, right ?
I'd say it belongs to the formatter to load the data it needs if not available...

Then again: the widget layer is supposed to hand out 'ready to store' values, meaning : similar to the ones we take from the stored data. Maybe field API should automatically run hook_field_load() on those on preview, before handing them to the display layer. That way the workflow on 'preview' would be much more similar to the workflow on regular 'load-then-display'. Not sure of the best way to tie this in Field API right now.

The other points are more taxonomy-related, I'll pass on those ;-)

amc’s picture

Issue tags: +taxonomy

tagging

berdir’s picture

Just a very minor DBTNG thing...

+      ->condition('t.vid', $vids, 'IN')

I think it defaults to IN now for arrays of values, so you don't need to specify it explictly.

yched’s picture

@bangpund: you can roughly test the approach I describe in #14 by adding

_field_invoke_multiple('load', 'node', array($node->nid => $node));

at the beginning of node_preview() - obviously not the final code, but should allow us to test the approach at least.

catch’s picture

@yched, taxonomy also previews newly added terms, which won't exist in the db, not sure if the formatter can possibly do that - although frankly that whole area is a complete mess and anything we do is going to be a pain.

@bangpound: let's leave configurable default vocabulary for creating new terms to a followup patch - i.e. for after code freeze, so we can push ahead with taxonomy_node_* removal asap. Same for validation of subtrees of a vocabulary - that's not an API change, can happily wait.

catch’s picture

Thinking about it, it might worth considering dropping the newly added tags preview - there's lots of things you can add on the node form which don't get previewed - menu links / book parentage for one (even if the menu/book block is displayed on the same page) - so if it allows us to clean things up a great deal elsewhere, it might be an acceptable loss - one which we could one day recoup by having a more general preview/rollback system in core.

yched’s picture

Discussed with catch on IRC: problem with running hook_field_load() on previews is that newly created tags don't exist yet, so term_field_load() wouldn't get the tag name and probably discard the entry.
Still, I think running hook_field_load() on previews makes tons of sense, so we agreed one workaround would be to have the widget validation step automatically create the new tag even on Preview, and pass on the tid. Then, the tag exists and hook_field_load() will load the additional data needed for preview display.

[edit: I think that IRC discussion happened after #19 ;-) ]

catch’s picture

Another option, although a bit more drastic, would be actually saving a new revision when doing previews and rendering that instead of the form array converted to a fake node. This might be easier when some of the issues with #282122: D7UX: "Save draft" and "Publish" buttons on node forms are resolved.

webchick’s picture

Subscribing for now!

Anonymous’s picture

StatusFileSize
new12.16 KB

Let's not make node_preview's problems the issue here. I took yched's advice about attaching the fields in there after validating and creating them in the validation function. This makes sense to me, because node preview is the problem right now.

The taxonomy_autocomplete function has been renamed to taxonomy_autocomplete_legacy so that the field widget autocomplete callback can squat there. This is all going to be gone soon, I hope.

catch’s picture

+  //$options
+  //$multiple 
+  //'#autocomplete_path'

These can go - maybe replace with a @todo for the autocomplete path setting?

+        $status = taxonomy_term_save($term);

$status seems to be set but not used?

+    // Don't select already entered terms.

Apparently we use 'Do not' rather than 'Don't' in code comments.

 if (count($tags_typed))

Can this be !empty()?

+	    ->where("LOWER(t.name) LIKE :last_string", array(':last_string' => '%' . $tag_last . '%'))

I'm pretty sure LIKE is cast to ILIKE on postgresql now - which is case-insensitive same as MySQL's LIKE, so we can do:

+	    ->where(":last string LIKE t.name", array(':last_string' => '%' . $tag_last . '%'))

and get the same results.

encode 'em.

;)

Looking pretty good!

Anonymous’s picture

StatusFileSize
new11.87 KB

Catch:

What kind of dirty trick is this you're trying to play on me?? ;-)

->where(":last string LIKE t.name", array(':last_string' => '%' . $tag_last . '%'))

Here's a new patch that takes all of your concerns into account. Except that one.

Anonymous’s picture

StatusFileSize
new11.72 KB

That was the wrong patch. This one is the right one.

catch’s picture

Status: Needs review » Reviewed & tested by the community

OK I took a look through, there's some TODOs here, but we really need to get this in to work on removing taxonomy_node_*() - where we'll be able to put it through it's paces refactoring the current core tests to use it. So marking RTBC.

yched’s picture

See #549710: Fields not rendered properly during comment preview for the 'real' version of "run hook_field_load() on previews".
Depending on which patch goes in first, the other one will adapt and cleanup.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Note: I'm tired and also don't quite understand yched's #28. So feel free to disregard any of these comments that don't really make sense.

+++ modules/taxonomy/taxonomy.module	14 Aug 2009 17:53:58 -0000
@@ -2052,3 +2091,144 @@ function _taxonomy_clean_field_cache($te
+  $field_key  = $element['#columns'][0];

Extra space here before =.

+++ modules/taxonomy/taxonomy.module	14 Aug 2009 17:53:58 -0000
@@ -2052,3 +2091,144 @@ function _taxonomy_clean_field_cache($te
+ * Process an individual element.
+ *
+ * Build the form element. When creating a form using FAPI #process,
+ * note that $element['#value'] is already set.
+ *
+ * The $field and $instance arrays are in $form['#fields'][$element['#field_name']].

Process an individual what element? A term? An autocomplete widget?

In general, it sounds like this documentation might be useful to someone who understands field API but it's completely greek to me. :\ Would this be more at home in the inline comments, or does it make sense here? Is there any way you can provide more context to someone who might need to call this function?

+++ modules/taxonomy/taxonomy.module	14 Aug 2009 17:53:58 -0000
@@ -2052,3 +2091,144 @@ function _taxonomy_clean_field_cache($te
+ * @todo Determine whether usability is harmed by allowing "multiple" to be 
+ * configurable.

Are we able to force multiple? That certainly seems like it would harm usability, forcing people to make the choice manually.

+++ modules/taxonomy/taxonomy.module	14 Aug 2009 17:53:58 -0000
@@ -2052,3 +2091,144 @@ function _taxonomy_clean_field_cache($te
+      // TODO: do i need to load the term? when is the term not available?

This sounds like it needs to be sorted out in this patch, or not?

+++ modules/taxonomy/taxonomy.module	14 Aug 2009 17:53:58 -0000
@@ -2052,3 +2091,144 @@ function _taxonomy_clean_field_cache($te
+    '#autocomplete_path' => 'taxonomy/autocomplete/'. $element['#field_name'] .'/'. $element['#bundle'],

Do we need to run that through check_url() or is that just being stupidly paranoid?

+++ modules/taxonomy/taxonomy.module	14 Aug 2009 17:53:58 -0000
@@ -2052,3 +2091,144 @@ function _taxonomy_clean_field_cache($te
+  if (empty($element['#element_validate'])) {
+    $element['#element_validate'] = array();
+  }

Hm. This property is not instantiated for you by FAPI? We might want to make a follow-up issue for that, since that seems like an annoying bit of code to have to keep in every element definition function.

+++ modules/taxonomy/taxonomy.module	14 Aug 2009 17:53:58 -0000
@@ -2052,3 +2091,144 @@ function _taxonomy_clean_field_cache($te
+  // Free tagging vocabularies do not send their tids in the form,
+  // so we'll detect them here and process them independently.

Sad panda. :( No way to couple these together?

+++ modules/taxonomy/taxonomy.module	14 Aug 2009 17:53:58 -0000
@@ -2052,3 +2091,144 @@ function _taxonomy_clean_field_cache($te
+      $typed_term_tid = NULL; // tid match, if any.

Please don't put comments to the right, only on top of the line to which they refer.

+++ modules/taxonomy/taxonomy.module	14 Aug 2009 17:53:58 -0000
@@ -2052,3 +2091,144 @@ function _taxonomy_clean_field_cache($te
+        $term = (object)$edit;

Space between the cast operator and the variable.

+++ modules/taxonomy/taxonomy.module	14 Aug 2009 17:53:58 -0000
@@ -2052,3 +2091,144 @@ function _taxonomy_clean_field_cache($te
+function taxonomy_elements() {
+  return array(
+    'taxonomy_autocomplete' => array(

Too bad we couldn't do a general autocomplete, but I understand the difficulties you hit.

Beer-o-mania starts in 16 days! Don't drink and patch.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new11.51 KB

@webchick:

The function taxonomy_autocomplete_elements_process is the Form API process function for the widget's form element. I borrowed from the process functions in options.module, so the comments here are consistent with those. The task mentioned in the comment block implies that there's some undesirable tight coupling between the element and the widget, such that the only valid way to call this now is to use the Field API widget. Even if it weren't, I would always rely on Form API to call this.

There's no #multiple setting on text fields for autocomplete. Really we're talking about the cardinality of the field. Can a widget be restricted only to fields that support multiple values? Or can a widget force a field to accept multiple values? I don't really know.

The question I had about loading the term is resolved. My primary worry was with previews, and the process function wasn't the problem nor the solution for that. TODO removed.

#element_validate is not instantiated automatically with an empty array, but it could arrive with some already-defined validation functions. I can't tell you whether it's a good idea to set up the element arrays with an empty array for #element_validate. I'll keep it in for now.

In order to store term IDs in the widget and submit them back to the application, we could not use autocomplete.js or even core's form autocomplete element. (autocomplete.js is a slight weakness here, and also with complex #ahah I would add.) This is why Node reference field widgets put [nid:###] in the text field. Autocomplete widgets can only deal with the value and not the key and value together except by overriding and inserting it into the user's input.

Autocomplete.js may also be partly to blame for the inflexibility of autocomplete widgets. If keys (term IDs) were stored in the form instead of just the value (term name) then there would not need to be any awkward shuffling done during validation.

yched’s picture

The task mentioned in the comment block implies that there's some undesirable tight coupling between the element and the widget, such that the only valid way to call this now is to use the Field API widget

That TODO is already present in text and option modules, I don't think we need to reflect it everywhere. I'm also not sure we can get that task done in time, I let #362058: Field Types: Make widget FAPI elements field agnostic. drift off my radar :-(

There's no #multiple setting on text fields for autocomplete. Really we're talking about the cardinality of the field. Can a widget be restricted only to fields that support multiple values? Or can a widget force a field to accept multiple values? I don't really know.

No on both points. Any field can be single or multiple and any widget handling multiple values ($widget_type['behaviors']['multiple values'] = FIELD_BEHAVIOR_CUSTOM) should handle the case where the field is actually single valued (i.e. in our case, fail validation if user input is "foo, bar")

#element_validate is not instantiated automatically with an empty array, but it could arrive with some already-defined validation functions. I can't tell you whether it's a good idea to set up the element arrays with an empty array for #element_validate. I'll keep it in for now.

Yeah, that's over-cautious code coming from CCK D6. I I saw it mentioned in other threads that a straight $array[] = 'foo' even if $array is not initialized as an array is tolerated, because the 'clean' way makes dull and verbose code.

Anonymous’s picture

No on both points. Any field can be single or multiple and any widget handling multiple values ($widget_type['behaviors']['multiple values'] = FIELD_BEHAVIOR_CUSTOM) should handle the case where the field is actually single valued (i.e. in our case, fail validation if user input is "foo, bar")

yched, thanks for correcting. I should have seen the real way to support multiple values, but I meant that the #multiple isn't a property on the text field. I can sort this out...

My usability concern (and webchick's) on whether a "tagging" widget should always support unlimited values is probably something for Field UI and field/widget settings to worry about... yes?

yched’s picture

I guess you could have a use case for a non-freetag taxo field with cardinality 1 or n (pick one value in this list). Obviously a 'taxo term' field on a freetag vocab with cardinality = 1 would be strange, but I don't think we can or want to introduce the notion of 'some field types under some conditions on field settings (vid) should always be multiple'.

At best, I guess the 'settings' form provided by Field UI could be form_altered to prevent or guide away from silly choices ?

Anonymous’s picture

StatusFileSize
new12.56 KB

I had to return the check in the process function to load the term when it's not already there. It's necessary for preview of objects.

The validation for multiple values is happening in the field's validation step, which is how I understood yched's comment.

webchick’s picture

Status: Needs review » Needs work

The autocomplete callbacks might need a small re-roll after #544418: Integrate CTools AJAX framework with Drupal to extend (and replace) existing ahah framework.

However, the more immediate problem is I tried this with the #516138: Move CCK HEAD in core patch and no field is appearing where I think there should be one:

Only local images are allowed.

I'm sorry, but I don't know enough about the various interactions to know if this is a bug in Field UI or a bug in taxonomy autocomplete, but I can't commit this yet. :(

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new5.58 KB

I applied the Field UI patch, uninstalled then reinstalled taxonomy.module, and then everything worked fine for me. Did you try with a clean install?

I can't see ajax.inc making a difference here since autocomplete widgets don't use AHAH.

autocomplete.png

yched’s picture

re webchick #35 - no widget: hm, I guess that depends on the order in which you apply the patches, but a manual registry rebuild and cache clear are probably needed. Should be OK in a real-life scenario.

webchick’s picture

Duh. Clear caches! What a n00b! :)

When using this with the Field UI patch, and adding a "Tagz" field to Page nodes, I'm still getting a few errors/weirdness. Please let me know which of these all under the purview of stuff that can be dealt with here and which do not.

--

I need to manually select "Unlimited" in the field settings in order for this field to act the way I would anticipate. But more troubling, when I attached a field that allowed 1 value to users, the data I entered just got silently truncated after the first value. EEK! I would expect an error message here. But I think this might be a bug in user module's Field API implementation.

Only local images are allowed.

Upon creating a field, after saving its final settings form:

Notice: Undefined index: field_tagz in taxonomy_autocomplete_validate() (line 2207 of /Users/webchick/Sites/core/modules/taxonomy/taxonomy.module).
function taxonomy_autocomplete_validate($element, &$form_state) {
  // Autocomplete widgets do not send their tids in the form, so we must detect
  // them here and process them independently.
  if ($form_state['values'][$element['#field_name']]['value']) { ## This is line 2207.

By just *visiting* the Page node add form, on the following page load, I get:

    * Notice: Array to string conversion in drupal_validate_utf8() (line 1128 of /Users/webchick/Sites/core/includes/bootstrap.inc).
    * Warning: preg_match() expects parameter 2 to be string, array given in drupal_validate_utf8() (line 1134 of /Users/webchick/Sites/core/includes/bootstrap.inc).

The tags I enter in one of my Page's tags field do not show up in my Article field (which comes from core taxonomy) as something to select from. I assume this is because this patch has to change the storage from the term_data table to the entity_field_whatever table.

Anonymous’s picture

This code can be used to test the widget without using the Field UI patch. This assumes a fresh 'default' profile install on D7 with 'article' node type and a 'tag' vocab that is vid = 1. It also adds the tag widget to users.

$field_name = 'field_tags';
$vid = '1';

$field = array(
  'field_name' => $field_name,
  'type' => 'taxonomy_term',
  'cardinality' => FIELD_CARDINALITY_UNLIMITED,
  'settings' => array(
    'allowed_values' => array(
      array(
        'vid' => $vid,
        'parent' => '0',
      ),
    ),
  ),
);

field_create_field($field);


$instance = array(
  'field_name' => $field_name,
  'label' => 'Tags',
  'bundle' => 'article',
  'description' => 'Enter a comma separated list of words',
  'widget' => array(
    'type' => 'taxonomy_autocomplete',
  ),
);
field_create_instance($instance);

$instance['bundle'] = 'user';
field_create_instance($instance);

Needless to say, I tested it. It gives no warnings. It works very nice.

Remember to zap the non-breaking space characters in your text editor if you copy and paste from the issue.

yched’s picture

re Webchick #38: I'm not where I can apply and test the patch, but it does have some code to raise an error if too many values are entered. Field validation on users is indeed borched, see #549726: user_profile_form_validate() not called when submitting user_profile_form.
More generally, this 'Check we don't exceed the allowed number of values ' code in taxonomy_field_validate() is absolutely not specific to Term fields or this autocomplete widget. I'm thinking this check should in fact be performed on all fields in a field_default_validate() function in field.default.inc. Followup patch.

About default cardinality set to '1': As I said in #33, I think that's an UI / form_alter issue. That's a bit complex though, because IMO having the cardinality default to 1 or unlimited depending on 'some criteria' might be equally confusing to users...

webchick’s picture

Status: Needs review » Fixed

Hm. I tried the code at #39 in a PHP node and just ended up with a WSOD.

Since testing bot is fine, and so are at least two other people reviewing this patch, I'm going to chalk this up to some sort of weird environment thing I've got going here, probably related to remnants of one of the 70,000 patches I've tested on this installation. Once #516138: Move CCK HEAD in core is in, it'll be much easier to track down any problems this patch may or may not have introduced. Tests will be updated in the patch that converts legacy taxonomy_node_X cruft to proper Field API, and then we'll be able to shake out anything else.

Therefore... committed to HEAD! :) Let the taxonomy evisceration continue! ;)

yched’s picture

drewish’s picture

I'm still getting the warning that webchick saw in #38 after adding a term field to a node (using the autocomplete widget):
Notice: Undefined index: field_tags in taxonomy_autocomplete_validate() (line 2207 of /Users/amorton/Sites/dh/modules/taxonomy/taxonomy.module).

Anonymous’s picture

Status: Fixed » Closed (fixed)
Issue tags: -Performance, -taxonomy

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