diff --git a/CHANGELOG.md b/CHANGELOG.md index 22ae187..5b03e02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# v1.1.3 +## 01/06/2016 + +1. [](#improved) + * Disable captcha by default, added instructions on how to enable it +1. [](#bugfix) + * Increase priority for onPageInitialized in the comments plugin over the form plugin one to prevent an issue when saving comments + +# v1.1.2 +## 12/11/2015 + +1. [](#improved) + Fix double escaping comments text and author + # v1.1.1 ## 12/11/2015 diff --git a/README.md b/README.md index 72aa4ac..e1d4eda 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,6 @@ Or clone from GitHub and put in the `user/plugins/comments` folder. # Usage -Edit the - Add `{% include 'partials/comments.html.twig' with {'page': page} %}` to the template file where you want to add comments. For example, in Antimatter, in `templates/item.html.twig`: @@ -49,9 +47,12 @@ The comment form will appear on the blog post items matching the enabled routes. To set the enabled routes, create a `user/config/plugins/comments.yaml` file, copy in it the contents of `user/plugins/comments/comments.yaml` and edit the `enable_on_routes` and `disable_on_routes` options according to your needs. +> Make sure you configured the "Email from" and "Email to" email addresses in the Email plugin with your email address! + # Enabling Recaptcha -The plugin comes with Recaptcha integration. To make it work, add your own Recaptcha `site` and `secret` keys the the plugin yaml config file. +The plugin comes with Recaptcha integration. To make it work, create a `user/config/plugins/comments.yaml` file, copy in it the contents of `user/plugins/comments/comments.yaml` and uncomment the capthca form field and the captcha validation process. +Make sure you add your own Recaptcha `site` and `secret` keys too. # Where are the comments stored? @@ -72,4 +73,4 @@ The plugin interacts with the Email plugin to send emails upon receiving a comme - Allow to delete comments from the Admin Plugin - Ability to see all comments of a page in the Admin Plugin - Ability to reply to a comment from the Admin Plugin -- Auto-fill the comment form when a user is logged in \ No newline at end of file +- Auto-fill the comment form when a user is logged in diff --git a/blueprints.yaml b/blueprints.yaml index 7416773..2962541 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Comments -version: 1.1.1 +version: 1.1.3 description: Adds a commenting functionality to your site icon: comment author: diff --git a/comments.php b/comments.php index 1dda2ac..743971d 100644 --- a/comments.php +++ b/comments.php @@ -26,7 +26,7 @@ class CommentsPlugin extends Plugin return [ 'onPluginsInitialized' => ['onPluginsInitialized', 0], 'onFormProcessed' => ['onFormProcessed', 0], - 'onPageInitialized' => ['onPageInitialized', 0], + 'onPageInitialized' => ['onPageInitialized', 10], 'onTwigSiteVariables' => ['onTwigSiteVariables', 0] ]; } diff --git a/comments.yaml b/comments.yaml index ea24031..a401c97 100644 --- a/comments.yaml +++ b/comments.yaml @@ -50,15 +50,15 @@ form: type: hidden evaluateDefault: grav.uri.path - - name: g-recaptcha-response - label: Captcha - type: captcha - recatpcha_site_key: e32iojeoi32jeoi32jeoij32oiej32oiej3 - recaptcha_not_validated: 'Captcha not valid!' - validate: - required: true - process: - ignore: true +# - name: g-recaptcha-response +# label: Captcha +# type: captcha +# recatpcha_site_key: e32iojeoi32jeoi32jeoij32oiej32oiej3 +# recaptcha_not_validated: 'Captcha not valid!' +# validate: +# required: true +# process: +# ignore: true buttons: - type: submit @@ -68,8 +68,8 @@ form: - email: subject: "[New Comment] from {{ form.value.name|e }}" body: "{% include 'forms/data.html.twig' %}" - - captcha: - recatpcha_secret: ej32oiej23oiej32oijeoi32jeio32je +# - captcha: +# recatpcha_secret: ej32oiej23oiej32oijeoi32jeio32je - addComment: - message: Thank you for writing your comment!