Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / comment_presave.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_presave.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/comment_presave.twig
new file mode 100644 (file)
index 0000000..3f51a57
--- /dev/null
@@ -0,0 +1,7 @@
+/**
+ * Implements hook_comment_presave().
+ */
+function {{ machine_name }}_comment_presave($comment) {
+  // Remove leading & trailing spaces from the comment subject.
+  $comment->subject = trim($comment->subject);
+}