Questions tagged [comments]

Use it for questions about entity comments.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

How to create a custom token from the parent entity of a comment for the Message module?

I have a site with Drupal, as well as the modules "Message" and "Token". I created a custom module based on the module "Message example". It is possible to create comments on several types of ...
1
vote
0answers
40 views

How to display the parent node or product of a comment?

I installed the Message module on my site. I created a custom module that created a message when a comment is created. https://imgur.com/a/4OLhGlL How to display the parent node or product of a ...
1
vote
2answers
36 views

How do I let non-admin user approve comments?

I'm looking for a way to allow a non-admin user to approve comments. I thought a Flag/Rules combination might be a solution but I can't figure it out. I added a content-moderator role, then I ...
1
vote
1answer
61 views

Mismatched entity and/or field definitions for comment field

I have been receiving this message ENTITY/FIELD DEFINITIONS Mismatched entity and/or field definitions The following changes were detected in the entity type and field definitions. Comment The ...
0
votes
0answers
30 views

How do I make comment URLs include the node URL on which they are displayed?

Default URL for comments is comment/1#comment-1. I would like it to be [node URL]#comment-1 where [node URL] is the URL of the node on which the comment is displayed. I have tried to use the pathauto ...
0
votes
0answers
27 views

How to display number of comments of a node as part of a “content” view with fields

I created a content view in D8, which shows me fields of a content type. Basically it works. Now I would like to have the total number of comments per listed node displayed as a view field ...
0
votes
0answers
12 views

How to add custom action to OPERATION dropdown in comment page?

In /admin/content/comment page, under "OPERATIONS", there is a dropdown menu with edit and delete actions for each comment, how can I add a custom action, such as Email in the dropdown menu? Any help ...
0
votes
1answer
15 views

override view Use administration toolbar

i have a view that using administration toolbar. Problemis theme suggestion is not showing the template names that should override the template. i guess because its using the administration toolbar .. ...
0
votes
0answers
13 views

Comment body not displaying

I have an interesting problem where the comment body does not appear with the comment. The field wrapping is in the HTML but the content portion is always blank. This problem occurs regardless of the ...
0
votes
1answer
21 views

comments module with infinite scroll

I've added a comment field to my content type. Now I'd like to add infinite scroll to the comments messages, so it shows by default some number of comments and when I click on the load more button, it ...
0
votes
0answers
16 views

Comment API Endpoint for restful module drupal 7 not working

I am trying to put comment to a node using POST method to the endpoint api/v1.1/comments Here is the API file: <?php /** * @file * Contains \Drupal\restful_example\Plugin\resource\comment\...
0
votes
0answers
15 views

Understanding the threading functionality of comments

I'm working on building my own module, and it uses functionality similar to comments, so I'm trying to use it as a reference. My module uses replies, which are 'threaded' to a parent reply. There ...
0
votes
0answers
24 views

How to integrate two modules

I'm currently working on modifying https://www.drupal.org/project/react_comments module to support https://www.drupal.org/project/comment_notify. I need advice. Comment Notify module marks comments ...
0
votes
0answers
18 views

change Comments per page

I need to change the comments per page value, I set it 50 from the field setting but in some pages, I need showing only 10 comments, not 50. I tried to use this method setSettings([ 'per_page' =...
0
votes
0answers
12 views

How to move comment submit button inside fieldset

I created a new group for a content type under Comments Fields (admin/structure/types/manage/page/comment/fields), and set the type Fieldset. Is there a way to move the comment Submit Button inside ...
0
votes
0answers
9 views

How do I create a link for unapproved comments of an article?

In addition to the default links (Delete, Edit, Reply, Approve), how do I create a link such as "Email" for unapproved comments of an article(ex: /comment/12#commnet-12)?
0
votes
0answers
18 views

How do I name the comment.tpl.php file to use it in my own theme?

I have copied comment.tpl.php from mytheme/modules/comment into root/sites/all/themes/mytheme/templates. What should I name it to override the core template? The form ID is places-to-go-entry. I ...
0
votes
1answer
33 views

How do I fix the errors I get after removing the comment field from a content type?

After I removed the comment field from the user interface, and uninstalled the Comments module, I can't open any Article node. In the Drupal log, I find this message. InvalidArgumentException: ...
0
votes
2answers
267 views

How to render author custom fields info on comment and node twig template?

I am trying to render the author Full Name and other authors customs fields information in comment.html.twig and node.html.twig. But not any of the fields that I made for users such as "First Name", "...
0
votes
0answers
22 views

How to specify the text format for comments? [duplicate]

I have created a custom text format for my comment type, where the user can have just few formatting tools when adding a comment. But in fact the user still can switch to Basic HTML under Text Format ...
1
vote
2answers
55 views

How can I leave Subject as blank when fill nothing in the subject field of a comment?

When we fill nothing in the subject field of comment, drupal will use the comment body as the value of subject. See the code in CommentForm::buildEntity // Validate the comment's subject. If not ...
0
votes
0answers
41 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
40 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
46 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
47 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
142 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!...
-1
votes
1answer
28 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
447 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
90 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
33 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
66 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
55 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 '...
2
votes
1answer
329 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
543 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
10 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
36 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
41 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
166 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
39 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
20 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
2answers
224 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
45 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
22 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. ...
2
votes
1answer
146 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
132 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
171 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
93 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
399 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
377 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
234 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 ...