Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I think this is a very common use function, also needed in the D7.
Do we have plan of this?
Comment | File | Size | Author |
---|---|---|---|
#7 | select_or_other_taxonomy.zip | 7.48 KB | elithorkelson |
Comments
Comment #1
rellis CreditAttribution: rellis commentedThere are no immediate plans for a 7.x version, no.
I do have an idea for reimplementing taxonomy_other using a
custom form element on the back end, e.g.
which would be cleaner than the current hook_form_alter()
code and which could be extended to do 'radios_other' and
'checkboxes_other', and could be used for selecting things
other than taxonomy terms...
In fact, I have something more or less working for 6.x --
a 'Select Other' module -- but haven't found time to
finish it. :/
If anyone's interested in porting the current taxonomy_other
code, or discussing a new implementation, let me know.
- Rob
Comment #2
tecjam CreditAttribution: tecjam commentedFor a current project - built with D7 - I desperately need this functionality.
I have a huge multi tabbed content type with probably around 20-30 Term Reference Fields. For some of these fields I need the option for a user to be able to add 1 other term if none of the already available are suitable.
The term reference fields are in most cases multiple selection. I really need this functionality as I can't really think of any other way to do it apart from maybe adding a simple text field below each term reference and use it if it has been filled instead of any of the above.
I could also maybe help get this project moving again, specifically in the D7 direction, by possibly helping out with some code / testing.
I am surprised this module isn't more used, or is there another solution, especially for D7, that I am unaware of that others may be using?
Comment #3
rellis CreditAttribution: rellis commentedI still have no plan to do a drupal 7 version in the near future.
You could look at the 'select_or_other' module.
I don't know if works with taxonomies or not.
Comment #4
elithorkelson CreditAttribution: elithorkelson commentedI have just finished adapting the Select or Other module to work with taxonomies on Drupal 7. It's the first time I've written Drupal code that might be useful to the community -- I'm not sure if I should make a new module for this code, work with rellis to roll it out as a D7 update of Taxonomy Other, or what. But in the meantime, if anyone wants to try out the code, feel free to get in touch; I'm happy to share.
Comment #5
gotobedsleepyhead CreditAttribution: gotobedsleepyhead commentedWould be keen to see this - can you post it please?
Comment #6
rellis CreditAttribution: rellis commentedHi. Sounds useful. Can you post your version here as a patch for the 6.x version ?
Comment #7
elithorkelson CreditAttribution: elithorkelson commentedHi there,
I'm not sure how to write this as a patch for the 6.x version -- I wrote this as a new module that requires the Select or Other module, not as an adaptation of the Taxonomy Other code. I just called it Select or Other Taxonomy for now. Should I rename it as a Taxonomy Other patch? Anyway, that's assuming the code actually works.
I'll enclose it as a .zip of the module dev code for now. If anyone gets a chance to try it out, can you let me know if it works and where you think I should go next?
-eli
Comment #8
rellis CreditAttribution: rellis commentedSorry, I missed that your new code is based on select_or_other.
You might want to follow up in the select_or_other issue queue...
select_or_other already has some support for cck fields, it might
make sense for it to add taxonomy support too.
Comment #9
Roze-1 CreditAttribution: Roze-1 commentedWorks good, thanks for your great work 'elithorkelson'
Comment #10
santam CreditAttribution: santam commentedThanks for the great work elitthorkelson, the module works great. I needed it for a taxonomy field on my user registration page and none of the existing term reference fields did what I wanted to.
Comment #11
kaizerking CreditAttribution: kaizerking commentedwhen i am enabling the module #7 i got this error
Warning: Invalid argument supplied for foreach() in element_children() (line 6300 of C:\xampp\htdocs\includes\common.inc).
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedWorks nice in d7, thanks
Comment #13
kaizerking CreditAttribution: kaizerking commentedthe error #11 remains same here
Comment #14
kaizerking CreditAttribution: kaizerking commentedthis is crashing the site the error #11
Comment #15
voipfc CreditAttribution: voipfc commentedI have tried #7 and the text field is not showing up.Could it be in conflict with something else?
It works. You have to click the Other item before the text field appears for editing. I didn't notice it because it appears at the very end, and I only tweaked on to it when I saw the image for Select (or other) project page
Comment #16
wachyudisonang CreditAttribution: wachyudisonang commentedThanks elithorkelson, for the module.
that's what i need.
Previously, i've made a custom module to display taxonomy form to create a new term within block.
now i just need to enable your module :)
The module works great.
Comment #17
MXTPlease elithorkelson, could you contact the maintainer of taxonomy_other to try to make a deal to integrate your code or do a submodule for taxonomy_other?
Thank you very much
Comment #18
Sk8erPeter CreditAttribution: Sk8erPeter commentedelithorkelson, this is a great initiative, thank you very much! Wouldn't you really please contact the maintainer of taxonomy_other to add you as another maintainer as others suggested (or start your own sandbox)? :)
Comment #19
chronowerx CreditAttribution: chronowerx commentedworks perfectly.
could not reproduce # 11
Comment #20
rbogdan CreditAttribution: rbogdan commentedsubscribe
Comment #21
wing112707 CreditAttribution: wing112707 commentedThanks Dude. it works for me. i suggest that this module will be officially release in the module list.
Comment #22
cameron prince CreditAttribution: cameron prince commentedWhen choosing the widget provided by this module at the time of field creation you cannot save the field settings page due to a "Category: Other is required" error.
The workaround is to create the field with the default select list term widget and then switch to this one after saving.
Also, if your field references a taxonomy that doesn't yet have terms, these errors are generated:
Notice: Undefined index: taxonomy_term in select_or_other_taxonomy_get_options() (line 112 of select_or_other_taxonomy.module).
Warning: Invalid argument supplied for foreach() in select_or_other_taxonomy_get_options() (line 112 of select_or_other_taxonomy.module).
Thank you for sharing the module. It saved me a lot of time.
Comment #23
cameron prince CreditAttribution: cameron prince commentedThe select_or_other_taxonomy module from #7 works, but breaks existing select_or_other functionality on non-term_reference fields and doesn't handle empty taxonomies very well. I believe I've fixed these issues and I've created a sandbox for the module here: http://drupal.org/sandbox/cameronbprince/1895832
Hopefully we can get this promoted to a full project.
Comment #24
Sk8erPeter CreditAttribution: Sk8erPeter commented@cameronbprince: elithorkelson created the module, not you, so I think it's not too ethical that you want to promote it to a full project under YOUR name without even mentioning the ORIGINAL AUTHOR (elithorkelson) of this module.
You should have rather written a personal email to elithorkelson, and ask him to upload this module to his own sandbox first (!!) and make you a co-maintainer.
Shame on you...
Comment #25
cameron prince CreditAttribution: cameron prince commentedThanks for you two cents... Obviously you haven't looked at the README.TXT included with the module which clearly shows Eli as the author. I have no intention on taking credit for anyone else's work. AFAIK, there is no facility provided in the sandbox to allow me to reference another author.
Eli posted this almost a year ago and has not commented since. It's a nice module but had bugs. I received some help fixing the module from xjm on the #drupal-contribute IRC channel and considered it my responsibility to give this work back to the community. The proper way to make this into a full module is by starting with a sandbox.
Maybe next time you should consider that it might be someone's first experience contributing and not come down on them so hard for mistakes.
My only desire in doing this was to help someone else, so shame on you!
Comment #26
Sk8erPeter CreditAttribution: Sk8erPeter commentedWhen I saw your post that YOU want to promote it to a full project (so it will be under your name), it pissed me off, because this way it seems like you "overwrite" elithorkelson's authorship and efforts.
I didn't try your modifications, but no doubt that your efforts were useful, and thanks for trying to share it with the community, but I thought it was more ethical to ask the original author about this first. If you click on his name, you can see a "Contact" tab... so I wrote a short message to him to ask his opinion about this.
Sorry if I hurt you, but I think this should be clarified, because authorship should be kept in respect. :)
Comment #27
elithorkelson CreditAttribution: elithorkelson commentedHi folks,
Yeah, just to clarify, I'm grateful for everyone's comments here. I'm happy being credited somewhere in the codebase, and it's entirely fine with me if others take over development of the module -- I haven't been working on Drupal much lately. So I appreciate Sk8erPeter's concerns for giving credit where it's due, but also Cameron's efforts to improve the code. I'm not very experienced with Drupal module development or release procedures myself -- this was just a tiny module I wrote up to handle a couple of edge cases in our systems. So if others find it useful and can improve it, I think that's great.
peace, Eli
Comment #28
Sk8erPeter CreditAttribution: Sk8erPeter commented@elithorkelson: thanks for the feedback, Eli! :)
@cameronbprince : I saw the changes in your sandbox, thanks for extending the description, and mentioning the author! :)
Sorry for the first temperamental reaction. :))
Comment #29
acbramley CreditAttribution: acbramley commentedThank you everyone, this is exactly what I was looking for. The one piece of functionality Select or Other Taxonomy is missing which I would love would be to allow admins to pick whether the terms created by choosing other appeared in the drop down for everyone else. But this can be done with form alters and a field so not a massive deal. +1 for merging this into select_or_other
Comment #30
haydeniv CreditAttribution: haydeniv commentedHi All,
There is talk about incorporating Select or Other taxonomy into Select or Other see #1716764: Incorporate Select or Other Taxonomy module.
What are your thoughts about this?
Thanks!
Comment #31
enap CreditAttribution: enap commentedcameronbprince's sandbox solution works out of the box (term reference fields). No errors.
Comment #32
haydeniv CreditAttribution: haydeniv commentedI guess what I am wondering is it looks like Taxonomy Other is not actively maintained. I am the maintainer of Select (or other) and people in my queues have requested taxonomy integration. As cameronbprince's solution is based on Select (or other) I am wondering if people would rather get the feature in a single module instead of 2 separate modules. Select (or other) already has a D7 release. What this would likely due is deprecate Taxonomy Other in favor of Select (or other) for D7.
I would really like to hear from rellis on this as well.
Comment #33
cameron prince CreditAttribution: cameron prince commentedWith as little overhead as the Select or other Taxonomy module would add, I agree that integration with Select (or other) would be preferable vs. having two modules. Please note that other users have discovered translation issues with Select or other Taxonomy, so it's certainly not entirely bug-free at this point, but does work well for most situations.
Comment #34
voipfc CreditAttribution: voipfc commentedThis is a good idea. It will be easier to keep them synchronized and prevent updates to one breaking the other
Comment #35
haydeniv CreditAttribution: haydeniv commentedLooks like this is going to happen then I am closing this as a duplicate of the Select or Other issue #1716764: Incorporate Select or Other Taxonomy module
Comment #36
haydeniv CreditAttribution: haydeniv commentedClosing it for real this time. :)