I think hashtags is a great and simple module. Nowadays a lot of people is familiarised with hastagging system and it could be implemented in a lot of sites. Here a couple of suggestions I think could improve the module and also make them suitable for more sites:

  1. Hashtags not just for nodes but also for comments.
  2. Selectable output taxonomy.

Regards.

Comments

nbchip’s picture

+1

Leopold-2’s picture

+1

Raul Cano’s picture

+1

BrockBoland’s picture

I started working on this tonight, and wound up refactoring a ton of code in the process. I've still got some cleanup and testing to do, but I'll have a monster patch to share pretty soon here. It will make changes outside the scope of this issue, but I hope that the maintainer is open to it to clean things up a bit and put the module in a better position to address other issues.

BrockBoland’s picture

StatusFileSize
new20.32 KB
new16.57 KB

Big huge patch attached. I also included a zip file of the individual commits (using git format-patch). These can all be applied using git am 0* if you'd like to review my commit history on this issue.

First off: I did not change the basic functionality of the module. Existing sites should be able to make use of this patch without having to change config options or even run update.php. The new config options default to the previous functionality; site admins can change these config options if they want to, but the module functionality will not change without

So, what did I change?

  • The big one: added two options to the settings form: "Remove unused hashtags when editing an existing node" and "Add hashtags from comments to the node." The first allows you to choose whether or not tags on the node should be removed if they no longer appear in the node body after editing. This option is not compatible with adding tags from comments. Let’s say a node is created with a couple of hashtags, and then a comment thread ensues where 10 more tags are added in various comments. If the original node author edits the node (without changing the hashtags there), the module would only see those original tags in the node body, so it would remove the other 10 that had been added. Otherwise, on node save the module would need to load all comments to scan them for tags, in order to build a complete list of tags that are in use, to determine which should be removed. Rather than adding that potential performance hit, I just made these two options mutually exclusive: if you are removing unused tags when a node is edited, then you cannot use hashtags from comments.
  • Split up existing functionality into smaller helper functions and simplified what I could.
  • Made use of field_get_items() API function instead of trying to directly access fields on the node object.
  • Cleaned up a lot of little things: trimmed trailing whitespace, removed the unnecessary (and incorrect) version number in the info file
  • Use $node->language to find and change body and term values on the node object, instead of assuming language neutral ('und') in most cases

There are still other things that need cleanup, like other places that should be using field_get_items().

Anonymous’s picture

Any movement on testing/review of patch? One way or another, this module would be much more useful if comments could use hashtags.

deanflory’s picture

These patches are not applicable to 7.x-1.4 that was released before your patch submission:

patch < hashtags-1551532-5.patch
patching file hashtags.info
Hunk #1 FAILED at 2.
1 out of 1 hunk FAILED -- saving rejects to file hashtags.info.rej
patching file hashtags.install
Hunk #1 succeeded at 20 (offset 2 lines).
Hunk #2 FAILED at 37.
Hunk #3 FAILED at 55.
2 out of 3 hunks FAILED -- saving rejects to file hashtags.install.rej
patching file hashtags.module
Hunk #1 succeeded at 1 with fuzz 2.
Hunk #2 FAILED at 49.
Hunk #3 FAILED at 272.
Hunk #4 FAILED at 293.
Hunk #5 FAILED at 302.
Hunk #6 FAILED at 355.
Hunk #7 FAILED at 381.
Hunk #8 FAILED at 413.
Hunk #9 FAILED at 448.
8 out of 9 hunks FAILED -- saving rejects to file hashtags.module.rej

Can you reroll this for the current version? Otherwise, without this functionality this module is pretty useless for sites that allow commenting.

Since the Twitter module will automatically link hashtags (@ & #) to twitter.com I don't really see this module being necessary unless you're trying to hijack the twitter hashtag system for your own means without it being relevant to the larger world.

BrockBoland’s picture

Unfortunately, I'm no longer using this module and don't have time to work on this. I'll have to leave this one to you guys.

lofos1’s picture

Issue summary: View changes

Hi BrockBand, do you by chance have some time to work on this this year ?

BrockBoland’s picture

I do not: I'm no longer doing Drupal development.

molnitza’s picture

Use my sandbox module. It works for me.

deanflory’s picture

Thanks molnitza, will check it out!

radamiel’s picture

Version: 7.x-1.x-dev » 7.x-1.5
Status: Active » Fixed

implemented in 7.x-1.5 - must run update.php

radamiel’s picture

Version: 7.x-1.5 » 7.x-1.4

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.