Hello,

I think this is a very common use function, also needed in the D7.

Do we have plan of this?

CommentFileSizeAuthor
#7 select_or_other_taxonomy.zip7.48 KBelithorkelson
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rellis’s picture

There 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.

  $form['myselect'] = array(
    '#type' => 'select_other',
    // ...
  );

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

tecjam’s picture

For 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?

rellis’s picture

I 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.

elithorkelson’s picture

I 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.

gotobedsleepyhead’s picture

Would be keen to see this - can you post it please?

rellis’s picture

Hi. Sounds useful. Can you post your version here as a patch for the 6.x version ?

elithorkelson’s picture

Hi 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

rellis’s picture

Sorry, 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.

Roze-1’s picture

Works good, thanks for your great work 'elithorkelson'

santam’s picture

Thanks 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.

kaizerking’s picture

when 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).

Anonymous’s picture

Works nice in d7, thanks

kaizerking’s picture

the error #11 remains same here

kaizerking’s picture

this is crashing the site the error #11

voipfc’s picture

I 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

wachyudisonang’s picture

Thanks 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.

MXT’s picture

Please 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

Sk8erPeter’s picture

elithorkelson, 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)? :)

chronowerx’s picture

works perfectly.

could not reproduce # 11

rbogdan’s picture

subscribe

wing112707’s picture

Thanks Dude. it works for me. i suggest that this module will be officially release in the module list.

cameron prince’s picture

When 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.

cameron prince’s picture

The 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.

Sk8erPeter’s picture

@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...

cameron prince’s picture

Thanks 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!

Sk8erPeter’s picture

When 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. :)

elithorkelson’s picture

Hi 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

Sk8erPeter’s picture

@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. :))

acbramley’s picture

Thank 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

haydeniv’s picture

Hi 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!

enap’s picture

cameronbprince's sandbox solution works out of the box (term reference fields). No errors.

haydeniv’s picture

I 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.

cameron prince’s picture

With 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.

voipfc’s picture

This is a good idea. It will be easier to keep them synchronized and prevent updates to one breaking the other

haydeniv’s picture

Looks 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

haydeniv’s picture

Status: Active » Closed (duplicate)

Closing it for real this time. :)