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.
If we are using flat comment view, we should not see a reply link in each comment IMO. Just a reply link on the original post and a comment form at bottom. This might be a core issue.
Comments
Comment #1
hunmonk CreditAttribution: hunmonk commentedi agree, but the current way comment module presents those links makes it basically impossible to alter them. i'm postponing this until we can fix comment module in D7.
Comment #2
aclight CreditAttribution: aclight commentedI haven't looked at D6 much yet so this may not be applicable, but on my D5 site I use flat comments with forums and have removed the reply buttons on each post/comment with this:
It looks like this should work in D6 if you just reverse the order of the parameters and check for $node->type == project_issue
Comment #3
dwwLooks like a reasonable approach. Seems like this is exactly the sort of thing hook_link_alter() was supposed to be good for. ;)
Comment #4
hunmonk CreditAttribution: hunmonk commented@aclight: i tried your solution on a D5 install, and it doesn't work. what it does is remove the 'add new comment' link from the actual node -- it does not remove the 'reply' links from each comment. D6 looks to operate pretty much the same way in this regard.
i fail to see how hook_link_alter() is going to help us here, when it's never invoked for the actual comment links themselves.
i see three options:
so, really, one isn't and option. i'll check w/ some of the theming gurus and see if there does happen to be a general solution we can employ. if not, then this issue should go back to postponed.
i'm pretty sure i've got all the bases covered here, but please let me know if i'm missing anything.
Comment #5
aclight CreditAttribution: aclight commented@hunmonk--Right, I think there's more to it than just using hook_link_alter(). I did this a few months ago and don't remember the details clearly, but I'll dig around on my site to see exactly what I'm doing.
But it's definitely possible--see, for example, http://www.igorexchange.com/node/355
Note that I've added a "Quote" button to all comments, but I'm pretty sure that button is added by quote.module and is separate from the reply link that's added by comment.module.
Just to be clear, what you're looking to do with this issue is what I've done at the link above, minus the "Quote" button, right?
I know that the reply button at the bottom of the page is added in the theme layer. I'm just not sure where the "reply" links in each comment are removed. I'll look into how I'm doing this and report back, hopefully fairly soon.
Comment #6
aclight CreditAttribution: aclight commentedHm...bad news
It looks like I'm doing this in comment_links() of comment.module:
That's going to disable reply links in all comments though, and since d.o uses threaded comments everywhere else, that's not what you want to do.
There are a bunch of issues with comment.module and flat forums. I'll try to find time soon to create a test site using the new dev version of project_issue to see if any of the ones I've run into before will be a problem with IFAC.
Sorry about my original idea here--I forgot that I had patched core to get this to work.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedAnyone else think we should move this bug to core and mark critical? It is sucky UI for sure ... I lean towards adding hook_link_alter to comments in some fashion.
Comment #8
hunmonk CreditAttribution: hunmonk commented@moshe: i'd love to fix it in core, but eaton's concern that i mentioned in point 1 above is probably a deal-killer.
by quick inspection, it looks like hook_link_alter() is basically designed for node links atm, and it seems awfully late in the cycle to be throwing this kind of curve ball in the mix.
if we really must fix it for d.o, then i'd probably advocate fixing it in the theme layer of the d.o theme for now, and then fixing comment module in D7.
Comment #9
SamRose CreditAttribution: SamRose commentedI totally agree with this issue, having the option described above would be awesome. In the mean time I am trying to solve the problem of reasonably overriding without editing core.
I was looking at http://drupal.org/node/44708 which seems to point towards the right direction, along with info in http://api.drupal.org/api/function/theme_links/5
I am trying to understand how this applies directly to the comments reply. I do understand that I would first edit template.php as described at http://drupal.org/node/44708 and then create a file links.tpl.php in theme folder. But, what I am struggling with is what to include in that links.tpl.php file.
How would I tell the template engine to override comment reply link only, in a inks.tpl.php file?
Comment #10
SamRose CreditAttribution: SamRose commentedPS. I should add that I am asking this question in the context of Drupal 5.x Any ideas greatly appreciated
Comment #11
langweer CreditAttribution: langweer commentedI would like to do the same, remove reply links from comments in my forum. And I can’t find a solution by overwriting something in my template.php. Does someone have a solution? I do not like to change core files, also seems that to be the only solution at the moment ...
Comment #12
SamRose CreditAttribution: SamRose commentedIt is possible to overwrite in template.php. When I have a chance, I will come back here and post an example of how I was finally able to do it
Comment #13
zmove CreditAttribution: zmove commentedI think SamRose didn't have chance....
Comment #14
SamRose CreditAttribution: SamRose commentedCopy this from "themes.inc" file under "/includes" directory into template.php, place template.php in your theme dir:
This is what needs to be modified to override the comments links in your theme.
Comment #15
dwwThat doesn't fix the problem -- you're just saying "override theme_links()". What we need to close this issue is an implementation of an override for theme_links() that actually removes the links when appropriate.
Comment #16
Zellius CreditAttribution: Zellius commentedCan you write a step-by-step explanation? please
Comment #17
SamRose CreditAttribution: SamRose commenteddww, I understand that my answer doesn't fix the issue, and accept what you are saying. Can you please elaborate on what you are looking for that *does* fix the issue?
Are you looking for a patch to existing comment.module, or a contribution that does this, or what? I am not clear on what people are looking for here, and would like to help, but want to put my energies in a productive direction. Thanks!
Comment #18
aclight CreditAttribution: aclight commented@SamRose: What we're looking for is a way to remove the "reply" links in issue comments only (ie. not in comments on the forums, etc.) that doesn't require hacking the core comment module. Your post in comment #14 above does not give a functional override of these reply links that does this. It might be that you didn't copy/paste your code correctly, because it looks like what you pasted there ends abruptly.
So, if you can provide a theme_links() function that removes these reply links on issue comments only, that might be something we could use on d.o. But a patch to the core comment module isn't what we're looking for, because there are reasons (given above in comment #4) why this might not be a good idea.
Comment #19
SamRose CreditAttribution: SamRose commentedOk, makes sense.
Comment #20
pcambraThe solution I've applied is copying the theme_links to my template.php and rename it as phptemplate_links.
Then, i've added this line before the foreach loop and voilà, all reply links are gone
unset($links['comment_reply']);
Comment #21
aclight CreditAttribution: aclight commented#189501: Project issue queue user experience - reply links at top and bottom only has been marked as a duplicate of this issue.
Comment #22
ajayg CreditAttribution: ajayg commentedThis is long due issue and due to timing with D6 was not assigned to core. Why not make this a core issue for D7 so we have better way to theme comments?
Comment #23
zbombicz CreditAttribution: zbombicz commentedMy solution is:
opinions?
Comment #24
kjarli CreditAttribution: kjarli commentedHere is my solution to hide them per node type:
Comment #25
phKU CreditAttribution: phKU commentedFollowing is my easy-light solution for implementing the behavior "allow users to edit their own comments as long as no follow-up replies have been posted". It's easy because it's just a template.php add and light because there's only one database request cached in a static variable.
Hope that helps :)
Comment #26
dww@phKU: thanks, but that's not really helpful here. ;)
A) That only removes the edit link -- users can still edit comments if they manually type in the right URL themselves.
B) You're trying to solve a completely separate problem than the one described in this issue. What you're talking about is more closely related to #389718: Prevent users from editing their own forum post once there are replies... Everything is so much easier for everyone involved if each issue remains focused on a single change, instead of lumping different features/bugs into the same issue.
Cheers,
-Derek
Comment #27
Rustan CreditAttribution: Rustan commented#24, kjarli: Thanks, very useful.
Comment #29
Bartezz CreditAttribution: Bartezz commented#24 works perfectly, thanx!
Oh and as a reminder, clear caches after applying this to template.php as always with changes to the template.php file.
It's monday morning and I forgot, took me 15 minutes before I had the eureka moment :)
Cheers
Comment #34
coolboygfx CreditAttribution: coolboygfx commentedAlso phKU's solution is verry useful for removing the edit link from all but last comment.
Thanks for sharing.
But for compatibility reason i suggest to replace `dru_comments` with {comments} in query.
Combining #24 and #25 together in one function is even more powerfull
and in fact, finally comments are starting to behave the way they should:-)
Comment #35
iparsin CreditAttribution: iparsin commentedI use "Flat List" to display comments. So, it makes more sense just to disable or remove "reply" link on each comment. My solution is to use hook_link_alter, sorry if I duplicated any of the above comments, it is long and old, so I might miss something, just want to share. I put this code in my custom module call "myfunction".
}
Comment #36
ravurihareesh CreditAttribution: ravurihareesh commentedCan we add fields in Comments?
Comment #37
iparsin CreditAttribution: iparsin commentedI never did, but believe "Node comments" might be what you are looking for. As it works like full nodes, so you may use cck to add fields and much more. IMO, use with your caution because natively Drupal builds something meant to be nodes, and some don't like "comments" or "users" for better optimization, but definitely we can modify them.
Comment #40
edgar_estor CreditAttribution: edgar_estor commentedthanks kjarli
clear the cache after using the script and DONE.. :)
Comment #41
spyderpie CreditAttribution: spyderpie commentedI can't seem to get this to work when showing comments in a view.
Any thoughts?
Julie
Comment #42
jaap76 CreditAttribution: jaap76 commentedI'm not to bothered about the reply link, but can someone tell me how I remove the 'login/ register' link from every single comment? Most of my visitors just have a look at my site, but don't have a membership. Thanks.
Comment #43
jaap76 CreditAttribution: jaap76 commentedIn fact, I have to correct my request. I would like to have the login/ register link only to be displayed on the first comment below the content. And if a user wants to login from node/33, that the user goes back to node/33 after being logged on. (like it is now, not a custom link that goes to the users profile)
Comment #44
Bartezz CreditAttribution: Bartezz commentedDoes this help? http://drupal.org/project/login_destination
Cheers
Comment #45
jaap76 CreditAttribution: jaap76 commentedThanks for your reply Bartezz.
I've tried this module, but couldn't figure it out. My php skills are not so great.
Comment #46
Bartezz CreditAttribution: Bartezz commented@Jaap, search in the issue queue for 'snippets', I'm sure there must be something you can use.
And maybe read up on some basic php skills, helps a lot when you want something else than standard in Drupal, and really isn't that hard to learn as you might think! Don't know the php level you are on now, but maybe this helps; http://www.tizag.com/phpT/
Cheers
Comment #47
jaap76 CreditAttribution: jaap76 commentedBartezz, I shall bookmark your url. Maybe I can solve the problem myself. Thanks.
Comment #48
dwwCan we please stop using this issue (which has a specific scope and purpose) as a general support forum for comment-related links on your site? ;)
Thanks,
-Derek
Comment #50
klonosIf the case is still as suggested in the issue summary, we should then either simply make the link take people at the bottom of the page where they can post a new comment or extend it to do something like fill in the comment text area with something like this:
For example, if I clicked the reply link from Derek's comment above, then this text area here should be pre-filled with:
@dww, #48:
...this way, all I'd have to do is perhaps clip Derek's comment down to the part I would be interested to quote and finally type my reply and hit the save button. What do you think?
Comment #51
Senpai CreditAttribution: Senpai commentedRegardless of the outcome of this one, its now a D7 issue since we're so close to the drupal.org upgrade re-launch.
Has anyone see the work that's been going on in:
And the Comment Easy Reply module, which is being considered for inclusion on drupal.org
Comment #52
dwwThis isn't just about d.o...
Comment #53
dwwI just discovered that even if you configure the node type not to display comment threading, core is *always* recording comment threading. Given how we choose to solve #1632492: Figure out and port project_issue comment numbering functionality to D7 this is sort of a big problem now. We definitely don't want people replying to specific comments and introducing threading. It's bad enough that the D6 migration is created comment threads to create the new comments for node revisions (e.g. issue summary updates) so that we don't actually renumber the main D6 issue followup comments. E.g. see http://git7site.devdrupal.org/node/1981038
Based on a quick IRC chat with drumm and tvn, tagging this for the d.o D7 upgrade and bumping priority...
Never a dull moment in d.o upgrade land. :/
Comment #54
drummI committed http://drupalcode.org/project/project_issue.git/commitdiff/0919d58d849f9... to take care of our comment ordering problem.
hook_comment_view()
is nice because it is invoked before comment_view() tries addingdiv
s. I'd rather have nodiv
s than extra CSS to hide them. The additionalnode_load()
should come straight from the cache and keeps our code clean.Comment #55
dwwThanks for that commit, drumm. I've got a fix for the rest of this but I can't get my laptop online right now to push it. I'll push later tonight and reply here to mark this fixed.
Cheers,
-Derek
Comment #56
dwwhttp://drupalcode.org/project/project_issue.git/commit/c3f99c9
Decided to turn this (and the thing about removing the indentation on threaded comments) into settings so that sites that don't want this behavior can easily turn it off. Just reusing all the nice project behavior specific settings plumbing we've already got from #1569524: Add a 'Project settings' tab on node type edit forms. Although, while I was working on this, I discovered and fixed a bug in how that stuff handled #states:
http://drupalcode.org/project/project.git/commit/64f1457
Anyway, the new settings are now configured how d.o will want them when the default node type is created. Therefore, this will eventually all be fixed automatically once this is merged into bzr and another rebuild happens.
Comment #57
dwwp.s. Now merged into bzr and should be live on git7site soon (although I can't access that site right now).