Closed (fixed)
Project:
User Terms
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Oct 2009 at 16:24 UTC
Updated:
2 Oct 2010 at 09:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
joachim commentedThis is definitely a desirable feature.
However, it's not something I need for my current project using User Terms, and the other maintainer of this module isn't doing much work on it at the moment as far as I know.
If someone else works on this and posts a patch, I will review it -- the defunct User Tags module had this functionality so it shouldn't be too much work to bring that over. Here's a good place to start: http://drupal.org/node/245582
Alternatively, I am available for paid customization of this (and other ;) modules.
Comment #2
anasynth commentedJust for the record I was able to mimic the functionality I described above.
I added a text field to the profile page which allowed users to enter a new tag if one was not currently available on the site. Some php then checks for errors etc and adds the tag to the correct vocabulary using a function from the taxonomy module. The tag is then available for selection from the list provided by User Terms.
By the way, I think that above I meant:
I'm afraid that I'm very new to drupal and programming in php so I won't be able to provide a patch, but I'd be willing to help as far as I'm capable.
Cheers
Comment #3
joachim commentedThat's not really the right way to do it.
Best way is to copy the way taxonomy module does it itself, reusing the functions where possible, and where not, copying the code with the necessary modifications. I only took a quick glance at the code for User Tags, but that seems to be the way that module does it.
Comment #4
Babalu commentedsubscribing
Comment #5
p4trizio commentedsubscribe
Comment #6
bachbach commented+1
Comment #7
hokuspokus commentedone more for "I can't wait for this"
Comment #8
joachim commentedSee my comment in #1 :)
Comment #9
mstef commentedGoing to start working on this now
Comment #10
mstef commentedLooks easy - should be done by the end of the day.
Comment #11
hokuspokus commentedGreat! You're a lifesaver if you are able to get this done!
Comment #12
mstef commentedOoooh yea..
Enjoy
Someone please review cause I chopped this thing up real fast.
Everything works fine for me so far. This widget on the profile edit form will now reflect whichever type you choose in the vocabulary settings - tags, select, etc.. Entering a new tag will create the term.
I might do a little work later on with changing how they show up on the main profile view (cause they're ugly and non-linked right now).
I'd like to have this pushed into the next release if possible. I'd be up to maintaining if the current maintainer wants that.
EDIT: Get the patch uploaded a few comments below
Comment #13
joachim commentedSounds great!
But could you post this as a patch rather than an archive please?
Comment #14
mstef commentededit
Comment #15
mstef commentedI'm going to create a patch now. Don't use the previously uploaded module. I found a small change I need to make in it anyway.
Be back in a minute
Comment #16
mstef commentedPatch!
Comment #17
mstef commentedComment #18
mstef commentedCan someone review/test?
Comment #19
joachim commentedI need to sit down and spend some time with this patch, as it affects the same parts of the code as #656428: Multiple vocabularies assigned to abitrary profile categories (which I need to reroll...).
Some initial observations:
I'm not keen on setting a second hidden value. Could we adapt $form['user_terms_vids'] to suit this?
Perhaps instead of just storing $vids, store an array of $vid => WIDGETTYPE?
I'm not sure why these bits getting unindented.
Powered by Dreditor.
Comment #20
mstef commentedAt the moment, this causes problem when free tags are used on the user registration form. I'll check it out in a little..
Comment #21
mstef commentedCan't figure out the point of this: user_terms_form_profile()
The param $account is your user. $user is never used afterwards in the code.
$default is loaded above, but also never used, as $default_terms gets loaded with the vocab defaults.
Am I missing something?
Comment #22
mstef commentedHitting /taxonomy/autocomplete/%vid requires 'access content' perms and that check wasn't added to the patch.
Comment #23
mstef commentedFixed!
Comment #24
joachim commentedYou're just returning nothing if the user can't see the autocomplete? Wouldn't it be better to just show a textfield without the autocomplete doodad?
Powered by Dreditor.
Comment #25
joachim commentedre:#21. That looks like old cruft. I'm filing a new issue to get rid of it :)
Comment #26
mstef commentedre:#24. That seemed like the best way to handle it (for now). I suppose a text field is a pretty good idea, but in my mind, I thought just to let the user fill it out on their profile. Tagging yourself on registration didn't seem necessary. Now that I think of it, even if it's not set to tags, a user without 'access content' perms shouldn't be able to see a select field that's loaded with tags too.
ah I'll fix it later.
Maybe just completely scrap from the registration form all together? Regardless, once we get rid of that pointless code I mentioned above, we can remove $register as a param, as I don't see it being used anywhere else. I'm going to hold off a little on creating yet another patch, as now we're straying a little far from free tagging. Maybe we can agree on these few topics, push my patch with these fixes into a new release?
Comment #27
joachim commentedI've dug a little deeper into the 'access content' permission thing.
Users need that permission not just for tagging autocomplete, but to access taxonomy/term/x and indeed anything to do with taxonomy.
So technically, we shouldn't show *any* taxonomy form to a user without that permission. This really needs a new issue: #784248: check 'access content' permission.
Comment #28
joachim commentedRegarding release, what I think I'd like to do is get these issues closed in the following order:
- #656428: Multiple vocabularies assigned to abitrary profile categories -- this may affect your patch here
- #784248: check 'access content' permission
- this one
- #784146: Useless code in user_terms_form_profile
Comment #29
hokuspokus commentedAny updates on Free tagging?
Comment #30
joachim commentedWhat I said in #28 still stands. There is a patch at #656428: Multiple vocabularies assigned to abitrary profile categories that needs testing. The sooner people help test it -- and that means you -- the sooner we get to a release.
Comment #31
joachim commentedOkay, the following are now in:
- #656428: Multiple vocabularies assigned to abitrary profile categories
- #784146: Useless code in user_terms_form_profile
The patch above can now be rerolled against the current code and then perhaps all the +1s can help with testing!
Comment #32
myha commentedRebuild patch for current code.
Comment #33
abudev commentedHi, I used #32 patch and i get this error when i click on the tag with autocomplete:
An HTTP error 0 occured - taxonomy/autocomplete/4
I gave to anonimous user all permissions and nothing changed. Is there something wrong with permissions? I tried everything.. Thanks
Comment #34
abudev commentedI found a workaround, removed my base_url and work now. I'll do more testing with the patch, please excuse the inconvenience.
Comment #35
joachim commentedPatch works great!
There are a few code tweaks I'd like to see before I commit it:
Why is this moving this out of the if (!empty($vids)) condition?
This should be the master switch on a particular vid. Test 'user_terms_tags_' . $vid below this to see how to handle the vocab.
Powered by Dreditor.
Comment #36
myha commentedI'm not a author of the patch but I think that return $form should be moved into if (!empty($vids)) condition. Also unset $edit['user_terms_tags_' . $vid] variable to not store in the data user property. Attach patch with this changes.
Comment #37
joachim commentedThanks for taking care of that myha :)
I'm working on a few things at the moment...
Bailing on the whole form? There may be other vocabs!
But in fact, subsequent to this patch first being written, I put a check for 'access content' on the whole user terms fieldset.
Now there actually is a corner case here -- if your users can't access content, you MIGHT still want them to tag themselves but WITHOUT the autocomplete. But this seems to me to be rather a bizarre case, so I think we should leave it off. If someone wants this they can provide a subsequent patch :)
I don't really like this. For starters it's not the same format as the other hidden value we use (and BTW -- use 'value' and not 'hidden' as the type for this sort of thing).
I am debating whether to fold this into the existing $form['user_terms_vids'], by setting the key as 'tags', so you'd have:
Pondering whether this is smart or hacky... :)
Comment #38
joachim commentedHere's a new patch with all those changes.
Please test!
As there are quite a few combinations of settings for this module, I'd like it if at least a couple of people test the patch. Try several vocabs, profile categories, registration, etc etc
Once this gets in I'll roll a 1.2 release :)
Comment #39
yeputons commentedAnd where is the patch? :)
Comment #40
joachim commentedOops.
Comment #41
naden commentedPatch runs without hassle. Thx!
Comment #42
doublejosh commentedMight be off topic here but, sure would be nice if User Terms could play well with Taxonomy Super Select for changing to either the: radio, checkbox, or freetag plus checkbox widgets!
Comment #43
joachim commented@doublejosh: yup, that would be best filed as a separate issue :)
Comment #44
joachim commentedOk, one review and no problems reported. This patch has been sitting around long enough; I'm committing it.
Thanks to mikestefff and myha for working on this and to everyone else who's contributed by reviewing or testing.
#617088 by mikestefff, myha, joachim: Added support for free tagging.