Closed (fixed)
Project:
References dialog
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Feb 2012 at 17:34 UTC
Updated:
8 Apr 2016 at 20:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
vasikei build a patch for this.
to accomplish this i had to define a new Taxonomy widget. For now it is based on the taxonomy term autocomplete widget form.
it still needs work, but i think can be a first step. feedback welcomed
Comment #2
andypostworking re-roll, require view to allow search work
has wrong selecting of field in view if there's a entityreference field in same bundle
Comment #3
andypostComment #4
andypostPatch fixes some code comments and adds actual vocabulary name after create button
Comment #5
kbasarab commentedI had to change this so as taxonomy_term_uri returns an array containing a path key:
$path = taxonomy_term_uri($term);
$path = $path['path'];
Other thing I found is that when a term is saved it shows just the TID in the autocomplete field the next time you edit. See screenshot attached.
Comment #6
andypostStrange, it work for me
Comment #7
brankoc commentedAfter applying the patch from comment 4, I get something similar as kbasarab. After saving my node and returning to the Edit view, the contents of the term reference fields have been replaced by numbers.
If I then click the Edit dialog button, I get a dialog with the following text:
('/drupal7' is the name of my installation.)
Applying kbasarab's fix makes the Edit dialog work.
According to the API, taxonomy_term_uri() always returns an array with a single item with the key 'path': http://api.drupal.org/api/drupal/modules!taxonomy!taxonomy.module/functi...
Comment #8
kbasarab commentedLets try this one out. This starts with #4 then fixes path as I found in #5. The term id as the defualt value is also addressed.
Interdiff is between 4 and 8.
Comment #9
kaizerking commented#kbasarab do we need to apply both? i,e the patch and interdiff.text?
Comment #10
kbasarab commentedInterdiff strictly shows the changes that I made to #4. All you need to apply is #8.
Comment #11
andypost@kbasarab is there any reason to display [tid] in field? Core does not do that.
Also
The code-indent is wrong
Comment #12
kbasarab commentedFor the TID in the input type I was building off of code that was already in the project to supporting that but it wasn't showing. In addition it was based off of how node reference fields work allowing the edit link to show based on the term ID. I think my thought behind this was to avoid an extra term lookup.
I'll take care of that code indent. Want to decide what to do with the TID portion first though and integrate all of them together.
Comment #13
andypostTID is never stored in taxonomy auto-complete so providing it will break core's behavior...
Take a look at core's implementation in taxonomy_autocomplete_validate()
Comment #14
vasikev2 of Taxonomy Term Reference Filter by Views aims to integrate with References dialog for Term reference.
i think i used the patch #4 for working on this integration.
Comment #15
andypostLooks like we could have simpler implementation for taxonomy.
The
$element['#entity']already havetidtid so no reason in new widgetComment #16
andypostI will re-roll the patch letter with hunk to fix settings.
Also the way of attaching reference widget should be refactored to make this work. Currently module uses
hook_element_info_alter()to attachreferences_dialog_process_widget()to each element that have #entity_type key in element array. This bring a lot of overhead and should be replaced with hook_field_widget_form_alter() introduced in drupal 7.8 but this require maintainer attention to this.This hunk still needed to patch work
Comment #17
andypost@kbasarab This patch get's tid from $element and only hunk for custom widget uses searching for [tid:N]
Actually I'd prefer to drop custom widget and move to
hook_field_widget_form_alter()implementation but the patch still uses old behavior to keep BCComment #18
vasikei tried the last patch (#17) and it did work for me.
Comment #19
keti-1931 commentedthanks a ton andypost patch #17 works for me great!!
Comment #20
kbasarab commentedI'm not sure we want to make the assumption we want these are uppercase. But I don't think this is a stopping point for this patch. Marking as RTBC.
Comment #22
rogical commentedComment #24
caschbre commentedI noticed that the dialog options only appear when using autocomplete... however it doesn't appear when using autocomplete (Tags style). Is that the expected behavior?
Comment #25
maximpodorov commentedIn references_dialog_term_reference_autocomplete_validate(), the following line is incorrect:
$value = array();
This should be used instead:
$value = NULL;
Comment #26
les limFollow-up patch for #25.
Comment #27
alhambra commentedThanks for the patches! Patch #26 works for me.
I changed the output of the 'create xx' link a bit:
Comment #28
alhambra commentedComment #29
Cogax commentedI had the following problem:
I have an vocabulary "categories" with an term "Events". I have a multilingual site, so i translated this term in german. In german it's also called "Events". So when i referenced that term in a german node, it takes the englisch term.
The followin patch fixes that by simply change the format like it is for node references.
Comment #31
WorldFallz commentedcommitted the patch from #27. I don't have the ability to test the multi-language patch from number 29.
In any case, please open follow-up issues for anything else related to the term reference integration (including the multi language issue from 29).