Needs work
Project:
Statuses (Social Microblog)
Version:
7.x-1.0-beta2
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 May 2015 at 04:55 UTC
Updated:
21 May 2017 at 17:52 UTC
Jump to comment: Most recent
Comments
Comment #1
icecreamyou commentedYeah unfortunately the way the submodule was implemented it tracks the relationship between @mentions/#hashtags and statuses in the database, so it's not designed to work on other content like status comments. However I think it's actually possible to make it work on comments without a patch by doing something like this (untested) in a custom module:
I'm certainly open to a patch if anyone wants to add support for something like this.
Comment #2
jweirather commentedThanks for getting back. I'll try your sample code on our site and let you know how it goes. If it does work, I may also try my hand at a patch.
Thanks again for all your efforts on this module.
Comment #3
jweirather commentedAs an aside (or +1), I've found that on my other social sites it seems that the feed "subscribers" use mentions in comments at least as often as the authors do in the original posts. As in: a "subscriber" tagging their friends who might not otherwise see or notice a given post. Just wanted to (ahem) mention that.
It's not as true for hashtags, but definitely for mentions.
Just my $0.02.
Comment #4
jweirather commentedInitial feedback: I'm on the beta2 version, and quickly modified the code to:
Note: statuses_tags_process_message. This did attempt to add the link to the comment, but it was encoded (by t function?) "...@<a href="..."
I'm going to attempt to upgrade to the dev version and revert to your original code to see if the issue persists and confirm that the mention is recorded and appears in the default views. In the meantime I wanted to post this back to see if you foresee any additional issues and/or point me in the right direction. I'm happy to try to sort it out, but any direction would be appreciated.
Thanks!
Comment #5
jweirather commented*note that the encoding I'm trying to paste is being rendered as html. suffice it to say that the processed message has URL encoded strings instead of a properly formatted link.
Comment #6
jweirather commentedUpdated to the dev version and the same issue persists.
The link code is trying to work, but this is the output as shown in the comment itself:
(In the resulting page's source code, that output is URL encoded.)
I'm happy to play this our further and try a patch, but would appreciate any guidance to get me started in the right direction.
Thanks
Comment #7
jweirather commentedSetting back to "needs work", as I do plan to work on this, and remain open to feedback/help
Comment #8
icecreamyou commentedstatuses_tags_process_message() was renamed to statuses_tags_add_links() in dev to avoid conflicting with the Message module.
The problem you're experiencing is that the preprocess hook adds the links before the input filter is run over the comment, and the input filter converts the HTML links to plaintext. If you change the input filter you're using to allow HTML links in your comments, it might work for you.
Avoiding this issue without modifying the module would probably require implementing hook_theme_registry_alter() and providing an entirely new theme callback for status comments instead of the default theme_fbss_comments_item(). (You could do something tricky in it like calling theme_fbss_comments_item() explicitly and then parsing the output, but that would be pretty gross.) Alternatively that function could be patched to add links if the statuses_tags module is enabled. Ideally there would be a setting for that, and there would be additional utilities for finding status comments with specific #hashtags/@mentions in them (or statuses with status comments that have specific #hashtags/@mentions in them...) but that's probably overkill for your use case.
Comment #9
jweirather commentedThanks for getting back with the detailed reply, it definitely shed some light on the situation. I recently had to enable HTML in statuses, so I'm curious to see if this fixes it. I'll be circling back to this in the next few weeks and will report back with results/patch.
While we're on the subject, I don't believe the UI offers the ability to choose Statuses text formats by role, but is there a way to do this with a theme function or hook? For example, I don't want normal users to be able to post HTML into statuses, but system-generated statuses should allow it.
Thanks again-
JPW
Comment #10
icecreamyou commentedYou can probably do this in a MODULE_process_HOOK() implementation or in a theme in order to change how individual statuses are rendered. You'd also need to change your Views though since statuses rendered through Views are constructed through Views fields. I'm sure there's a way to make that work - not sure exactly the right approach offhand.
Comment #11
ugintl commenteddid you get it working?