Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [comments]

Use it for questions about entity comments.

0
votes
0answers
37 views

Displaying same username for all users with a specific role as comment author

I need to display the same username for users of a specific role as comment author. I have a Role 'Board Moderator'. When users with this role are commenting, a uniform name 'OneUserNameForAll' ...
1
vote
1answer
20 views

How to create a view to count comments per user?

I am trying to create a view with a table that shows all the users and the total number of comments that user posted in descending order. I am not sure what I am doing wrong but I spent hours on this ...
0
votes
0answers
32 views

What's the correct way to create a custom formatter for a comment?

I'd like to create a custom formatter for the field Comments. My goal is to display a custom comments section beside CKEditor (URL /node/xx/edit). Following this article, I created my custom module: ...
0
votes
0answers
26 views

Comment file upload not working

Looks like we have two versions of jQuery loading. Hence the "(...).once is not a function" errors in the console. jquery.once is definitely loaded but only for the first version of jQuery. Nightmare....
-1
votes
1answer
31 views

How to add reply link under every comment?

I using standart Drupal 8 module for comments. Can I add reply link under comments or I have to install another module? I'm log in as administrator, but i dont see edit/delete/reple link Help please!...
0
votes
1answer
19 views

Can not use a comment display mode

In my comment type, I created a "teaser" view. When I enable the debug mode in the "service.yml" file, the display modes of the comments do not appear in the suggestions. Why ? How to use a ...
0
votes
2answers
65 views

Validation with hook_form_alter()

In Drupal 8, for the Comment entity, I want to validate an integer field (stored as field_nieuwe_waarde_value). In each comment posted for a node, it needs to be greater than the value for the ...
0
votes
1answer
41 views

Why are the edit/delete/reply links missing in the Comment module?

I'm using 8.6.0 core's Comment module. I can add comments, but I can't edit or delete them. I also can't reply to anyone else's. Permissions have been set that all authenticated roles can edit. I'm ...
0
votes
1answer
30 views

Anonymous users skip comment approval but they shouldn't

In my drupal 8.6.1 news blog anonymous users can skip comment approval althouth permissions are set to not skip. I rebuilt the permissions but nothing changed. Also in comments page I see that some ...
0
votes
2answers
40 views

Custom submit handler stops working when checking route

I'm trying to setup a custom submit handler, so I can change the redirect URL after submitting comments. Edit: I just want to send users back to the page they were viewing to begin with, but it's a ...
2
votes
1answer
34 views

How to implement per user caching when restricting display of comments by author

I have threaded comments on a site where there are two roles, reviewers and administrators. Comments are shown in a view block added to the node (in this case a webform). The view format is set to '...
1
vote
1answer
139 views

Why doesn't the token for the node title work?

In Drupal 8, I activated the Message module and the Message Example sub-module. These are the fields I added to the template to create a message when a new comment is created. This is the ...
1
vote
3answers
176 views

How can I get all comments for a node?

I have have a content type (Stuff) with an entity reference field (comments) for comments (their type is Stuff comments) with a single field (comment_body). Inside a controller, I loaded a node by ...
0
votes
0answers
9 views

Comments on Arabic version of page are not shown under content after admin approval

I am working with drupal8 website. Here am using both arabic and english translation. Authenticated users have the permission to post and view the comments. When an auhenticated user posted a comment ...
0
votes
1answer
25 views

Why do users with permission to post commenst get “You do not have permission to post a comment”?

I have some users with roles administrator, authenticated etc. All such user roles have permission to post a comment. But when posting a comment it is showing error "You do not have permission to ...
0
votes
0answers
33 views

Make forum comments search result links redirect to related topic

We have built an intranet with Drupal 8 and this has been upgraded to 8.5x, it uses forums extensively (one of the intranet's main purposes). We are also using Solr search so we can search all content ...
0
votes
1answer
72 views

Author image in comments twig

I succesfully get user name, surname and date to render in comment.html.twig like this function MYTHEMENAME_preprocess_comment(&$variables) { $comment = $variables['comment']; $variables['...
-1
votes
1answer
37 views

How to get top 5 user according to comment post? [closed]

I have a site which has a blog content type. In blog detail page users post comments. Only Authenticated user submit comment. Now I want to show top 5 users who post most comment on site.
1
vote
0answers
19 views

Is there a way of displaying the IP address of a comment in a view?

I have created a view to help me manage spam. Its main shortcoming that it does not display the IP address the comment came from. Is there a way to obtain the IP address the comment came from? When ...
0
votes
0answers
13 views

Comment_body not saved correct

I have 2 forms in 2 seperate modules. Each module has an own custom comment form. Form A is working perfect but Form B which is a copy of A is saving the comment_body field as regular text instead. ...
0
votes
2answers
134 views

Cycle comments on field--comment.html.twig

I would like to add a div for every comment on my field--comment.html.twig On the template I've a "comments" variable, but if I cycle in this way, I obtain error (Fatal error: "0" is an invalid ...
-2
votes
2answers
43 views

Match Users skills [closed]

I am designing a website and there are two users 1:users and 2:company. I want two field in different account need to match with each other. If users provide specific SKILLs and company requires ...
1
vote
1answer
21 views

Last Comment Name field is not removed after account cancellation

After cancelling the user under(Delete the account and make its content belong to the Anonymous user). Forum posted by is changed to "Anonymous" but comment name is still displayed in the forum. ...
0
votes
1answer
73 views

Drupal 8, make comment subject a required field

I am pretty new to Drupal and simply cant figure it out. I've set up a comment type for a content type. I want to use the default subject field as comment title and want to make it required. I know, ...
0
votes
1answer
71 views

Fatal error: Call to undefined function node_type_get_names() Drupal 7.59

I upgraded my Drupal site to Drupal 7.59 and now the site is down. Fatal error: Call to undefined function node_type_get_names() in D:\Development\xampp\htdocs\biobank\modules\comment\comment.module ...
1
vote
1answer
84 views

Disabling reply link for comments not working

I would like to disable reply to comment for anonymous user. I saw on sereval topics that you have to unset $variables['content']['links']['comment']['#links']['comment-reply'] So I ended up ...
0
votes
1answer
27 views

Views field that links to fragment URL of comment on /node/ instead of /comment/

With Views, I want to output a list that links to each comment of the current node. But instead of linking to /comment/42#comment-42 I want to link to /node/23#comment-42 I tried these fields, ...
1
vote
2answers
190 views

Comment template for specific comment type

How can I have a comment template (comment.html.twig) per comment type? The Twig Template naming conventions documentation explains how I can get a comment template per node content type (comment--...
1
vote
1answer
247 views

Add comments to Webform submissions

I'm trying to figure out allow commenting on the submissions so there can be a back and forth dialog between the user and site admin(s). In Drupal 8 webform submissions are entities (type: ...
0
votes
1answer
111 views

How to display the profile url in the comments?

I have the module : https://www.drupal.org/project/profile https://www.drupal.org/project/twig_tweak Here is the twig file of my comments : {# /** * @file * Default theme implementation for ...
0
votes
1answer
33 views

Allows users to pass from flat to threaded view for forum comments

We've migrated a site from Drupal 5 to Drupal 7, and we were unable to figure out how to allow user to change between flat and threaded view for the forum comments. This was possible in Drupal 5, but ...
0
votes
1answer
52 views

Can I manually migrate comments?

I have a Drupal 7 site and I'm thinking about upgrading it to Drupal 8. I want to refactor the site, so I just need to export the content. So far, I've tested exporting content types using feeds ...
0
votes
0answers
31 views

When added comment line break is not showing drupal7

I have a content type called comment.It has a comment body field.It is a long text field.When i added a comment with line break,it is not showing.All the comments are showing in a single line. Can ...
0
votes
1answer
196 views

Json api create comments

I am using the JSON API module and I would like to create a comment. I was able to create nodes based on the documentation found here, but I can't figure out how to create comments. How can I add a ...
1
vote
1answer
204 views

Multilingual comments in Drupal 8

I set up an English/Arabic Drupal 8 website. However, comments are misbehaving. When a user enters a comment in the English version of the article, it appears in the Arabic version, and vice versa. I ...
0
votes
1answer
25 views

Comments not showing up when set to open and assigned a region in manage display in drupal 7

I just set my comments for my content type to "open" and assigned the comment field to show up in the full content manage display. But it doesnt show up when viewing in my full display node. I tried ...
0
votes
0answers
114 views

Fatal error: Call to a member function setDefaultValueCallback() on null modules/comment/src/Entity/Comment.php on line 221

On Drupal 8.2.5 site I'm getting the following error that is showing up on at least the following operations: duplicating or creating a new view, modifying the position of the main menu items, ...
0
votes
2answers
28 views

D8 - show view in comments depending on user role

how i have to set up a view with Drupal 8 to show a field in the comments when the user_role is NOT "admin". im not sure what kind of relationship and contextfilter i need to to this? background: i ...
1
vote
1answer
72 views

How to send auto email for new unapproved comments?

How do I config to send auto email for new unapproved comments. I enabled the comments module and anonymous user can create comments in some content types. But, I want to receive in an specific ...
0
votes
0answers
20 views

Comment status availability and accuracy in a view

Accessing the comment status in a view seems to be an incomplete implementation. The comment status does not appear in the view's FIELDS | Add list directly. I discovered that if I add the comment ...
2
votes
0answers
143 views

Comment Notification with Message Stack / Message Notify

The message stack has three main modules: Message, Message Notify and Message Subscribe. One thing that it can do, is notifying node author of comments in their nodes. This is very much needed ...
1
vote
2answers
128 views

Remove reply link in comments

How can you remove the reply button under each comment in Drupal 8? I understand there is an option "Show reply form on the same page as comments", but I am not trying to remove this form. Only the ...
-1
votes
1answer
40 views

Prevent comment author name from truncating

In Drupal 8, long comment author names are truncated. These comments are from anonymous users. When I use the following preprocess function, Drupal responds with a HTTP 500 code, and I have to restore ...
0
votes
1answer
311 views

How to display in a view the comments of a flagged node?

1) I created a personal "Flags" called "Follow" on the nodes. 2) I created a page view (comment) that displays the comments of the flagged nodes. So far everything works. Now I want comments to be ...
1
vote
1answer
33 views

Which function should I use to update a node through the comment form?

I use this function to synchronize a comment field with the value from a field that exists in the node the comment belongs to. function mymodule_comment_create(\Drupal\comment\CommentInterface $...
1
vote
1answer
347 views

Show comment author e-mail in comment.html.twig

Anonymous users can leave their e-mail when posting a comment but how can I display this e-mail as a plain text value in the comment.html.twig?
0
votes
1answer
51 views

“New” Marker for Comments does not vanish

The "New" marker above comments does not vanish in my theme. It is basically vanilla Bartik with some tweaks. The marker is hidden by default and inserted via JS according to this comment in comment....
2
votes
1answer
145 views

Notification of new comments for author and comment writers

I'm trying to implement a rule (in D7) that will automatically (no check box or opting out): send an email to the author of node if new comments send email to all users who have commented on that ...
1
vote
0answers
27 views

Reply on comments

My content type has a comment field with Show reply form on the same page as comments checked. Posting comments works fine; unfortunately, there is no way to reply on the comments. Can somebody ...
0
votes
1answer
405 views

Override buildForm() in another module

I would like to override the buildForm() method of the Comment module in my custom module. The method is defined in core/modules/comment/src/Form/CommentAdminOverview.php. To achieve this, I've ...