http://drupal.org/project/entityreference is popular module that has replaced "Term reference" fields on many installations. Have you considered supporting it?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | entityreference-support-field-widget_1945446-4.patch | 3.61 KB | henrijs.seso |
| #3 | entityreference-support-field-widget_1945446.patch | 3.62 KB | henrijs.seso |
Comments
Comment #1
stborchertNope, not yet.
And I doubt this will happen unless some writes a patch for it or one of our customer projects forces me to integrate it since I'm quite busy at the moment. :/
Comment #2
henrijs.seso commentedI see, I will probably supply patch then.
Comment #3
henrijs.seso commentedGood news everyone! Here is patch that enables Entity reference support in for field widgets. As it turns out it was not that hard. There are just two differences between Taxonomy and Entity reference.
First problem was fixed by making SHS little more agnostic, we take column key from field data, that means module will use
tidfor Taxonomy module andtarget_idfor Entity reference. Second problem needed simple logic in finding vocabulary name, so basically four lines needed to be adjusted for compatibility. That's pretty much it for now. I will look into field formatters later, but this can be commited as field formatters and views support does not really depend on these changes and changes are backwards compatible.Comment #4
henrijs.seso commentedSmall change in patch. This will apply cleanly if you first apply patch from #1968308: SHS does not work in field collections, posible other side effects.
Comment #5
kaizerking commentedhow do we use this?
i have content types
1, 2, 3
2 is referenced in 3
1 is referenced in 2
1
1-2
1-2-3
now i want to create a exposed filter view to deepest level that is 3
i want use this in side a field collection which is shopping cart line item. the above content types are hierarchical categories of product
Comment #6
henrijs.seso commented@kaizerking Only taxonomy terms in hierarchical vocabularies are supported by this module.
Comment #7
kaizerking commentedoh.ok, then the issue title misrepresents the issues here or am i missing some thing?
entity reference -taxonomy terms would be a better title
Comment #8
stborchertWell, that wasn't as easy as it seemed to be.
I've applied the changes from mansspams and added some more magic to reduce the possible target types to terms only. Otherwise users would try to select nodes or something else (as kaizerking did) which doesn't work.
One additional problem I couldn't solve: while you may select multiple vocabularies as source for the field it is not possible at the moment to use this feature in Simple hierarchical select. Only terms of the first selected vocabulary are displayed as options. I did not know yet how to implement this because this would require a rewrite of many functions and structures (especially function
shs_term_get_children()).So for now we stick with one vocabulary only.
Comment #9
kaizerking commentedHow about other entities:)
build hierarchies with the help of some contrib mod ....and.. apply shs.. looks very long process.but nothing is impossible when you really try.hierarchical select was pain until the SHS:).
keeping this here for future reference.http://drupal.org/node/1540868
Comment #10
henrijs.seso commented@stBorchert Thumbs up. One vocabulary will do for now.
@kaizerking That would be out of current module scope I guess.
Comment #11
stborchertI guess I've found a solution for the "multi-vocabulary" problem. Will try and report if it worked.
And yes, using other entity types as taxonomy terms is totally out of scope for Simple hierarchical select. This will not be part of this module.
Comment #12
stborchertPhew, I finally managed to solve nearly all the problems with entityreference. Using option "multiple values" for views filters is a littly tipsy at the moment (the filter itself works but the selected options are not displayed correctly) but this is a minor problem.
Comment #13
oenie commentedIt seems this patch has reintroduced a previous issue #1949624: The widget always pre-selects first value in vocabulary when it is required field , on the level of the views exposed filter.
Comment #14
henrijs.seso commentedCould you compare patch in that issue and this one to narrow down where they conflict? I'm little bussy at the moment.
Comment #15
stborchertThis has been fixed long time ago.
Comment #16
orkutmuratyilmazDo you consider implementing this patch to 7.x-1.7 version?
Comment #17
inno81 commentedThis patch seems to break the behaviour of "Render views filter as select list" in the views settings for non-exposed filters, for entityrefrence fields.
Basically, you don't get to choose the terms with checkboxes, instead you have a plain text field.