4

Drupal already shows a similar message, to the users who has the post comments permission but not the skip comment approval permission. There is no need to use custom code for that: Don't give the skip comment approval permission to the users whose comments must be approved. If the purpose is changing the message shown by Drupal in that case (Your comment ...


2

For PSR-2 loading to work is important: Check namespace, folders are coherent. If your module is ahrq, ensure the namespace uses ahrq, and the folder it sits is ahrq/src/Plugin/views/field. Check the casing is respected just in case (lowercase/uppercase matters). Ensure the file is named CustomCommentBulkForm.php Yeah, obvious, but have you cleared your ...


2

Assuming $entity is a comment entity as shown in the screenshot, use: $commented_entity = $entity->getCommentedEntity();


1

You would need to add a custom submit handler, and set your message there. function ahrq_form_alter(&$form, FormStateInterface $form_state, $form_id) { else if($form_id == 'comment_comment_form') { $form['actions']['submit']['#submit'][] = 'ahrq_comment_form_submit'; } } function ahrq_comment_form_submit(&$form, FormStateInterface $...


Only top voted, non community-wiki answers of a minimum length are eligible