diff --git a/CHANGELOG.md b/CHANGELOG.md index 563da95..4a4208b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.0.9 - 2021-08-27 +### Changed +- The controller action is now logged when a form submission is rejected for easier debugging ([#21](https://github.com/putyourlightson/craft-snaptcha/issues/21)). + ## 3.0.8 - 2021-08-25 ### Changed - Excluded the `templates/render` controller action from being validated ([#20](https://github.com/putyourlightson/craft-snaptcha/issues/20)). diff --git a/composer.json b/composer.json index f2ccae8..603c041 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "putyourlightson/craft-snaptcha", "description": "Automatically validates forms and prevents spam bots from submitting to your site.", - "version": "3.0.8", + "version": "3.0.9", "type": "craft-plugin", "homepage": "https://putyourlightson.com/plugins/snaptcha", "license": "proprietary", diff --git a/src/services/SnaptchaService.php b/src/services/SnaptchaService.php index 276a7bd..55103cc 100644 --- a/src/services/SnaptchaService.php +++ b/src/services/SnaptchaService.php @@ -407,8 +407,8 @@ private function _reject(string $message, array $params = [], Action $action = n { if (Snaptcha::$plugin->settings->logRejected) { $url = Craft::$app->getRequest()->getAbsoluteUrl(); - $action = $action ? $action->getUniqueId() : 'NO_ACTION'; - $message = Craft::t('snaptcha', $message, $params).' ['.$url.'] ['.$action.']'; + $message = Craft::t('snaptcha', $message, $params).' ['.$url.']'; + $message .= $action ? ' ['.$action->getUniqueId().']' : ''; LogToFile::log($message, 'snaptcha'); } }