[support] How to populate an array to select a taxonomy reference

Jeff Greenberg listmail.ayendesigns at gmail.com
Fri Jun 7 02:51:17 UTC 2013


I have an ajax callback for typeahead of a taxonomy reference field. In the
value part of the array I put the term with a beadcrumb, so if it's Lab,
the value looks like

Dog > Sporting > Lab

The problem I'm having is the key. When I get to the validate function and
dump the value of the reference field, the key I use in the select array is
in the term->name field, and the term->tid field contains 'autocreate'.
I've tried putting just the tid in the array key, then tid:title,
title:tid, and finally I used the example (for node reference) in the
example module's ajax typeahead example, which is

          $matches[$term->name . " [$term->tid]"] = $name . $term->name;

($name is the taxonomy breadcrumb).

How do I load the array so that the selected term is shown in the reference
field as $term->tid = tid and $term->name = name?

---
drupal.org/user/367108
linkedin.com/in/jeffrgreenberg
accidentalcoder.com / ayendesigns.com
@accidentalcoder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20130606/b0239b6a/attachment.html 


More information about the support mailing list