From 661ac5a05a60a1e1ad9364f774c37760150510cb Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sun, 27 Oct 2024 15:12:06 +0000 Subject: [PATCH 1/3] Monolog2 fixes --- CHANGELOG.md | 6 ++++++ form.php | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44896bd..95ee4ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v7.4.2 +## mm/dd/2024 + +1. [](#improved) + * Updated logging methods to support Monolog2+ + # v7.4.1 ## 10/22/2024 diff --git a/form.php b/form.php index ca86c9e..853014e 100644 --- a/form.php +++ b/form.php @@ -506,7 +506,7 @@ public function onFormProcessed(Event $event): void 'message' => $message ])); - $this->grav['log']->addWarning('Form reCAPTCHA Errors: [' . $uri->route() . '] ' . json_encode($errors)); + $this->grav['log']->warning('Form reCAPTCHA Errors: [' . $uri->route() . '] ' . json_encode($errors)); $event->stopPropagation(); @@ -556,7 +556,7 @@ public function onFormProcessed(Event $event): void 'message' => $message ])); - $this->grav['log']->addWarning('Form Turnstile invalid: [' . $uri->route() . '] ' . json_encode($content)); + $this->grav['log']->warning('Form Turnstile invalid: [' . $uri->route() . '] ' . json_encode($content)); $event->stopPropagation(); return; } @@ -1262,7 +1262,7 @@ protected function loadCachedForms(): void if ($forms) { $this->forms = Utils::arrayMergeRecursiveUnique($this->forms, $forms); if ($this->config()['debug']) { - $this->grav['log']->addDebug(sprintf("<<<< Loaded cached forms: %s\n%s", $this->getFormCacheId(), $this->arrayToString($this->forms))); + $this->grav['log']->debug(sprintf("<<<< Loaded cached forms: %s\n%s", $this->getFormCacheId(), $this->arrayToString($this->forms))); } } @@ -1286,7 +1286,7 @@ protected function saveCachedForms(): void $cache->save($cache_id, $this->forms); if ($this->config()['debug']) { - $this->grav['log']->addDebug(sprintf(">>>> Saved cached forms: %s\n%s", $this->getFormCacheId(), $this->arrayToString($this->forms))); + $this->grav['log']->debug(sprintf(">>>> Saved cached forms: %s\n%s", $this->getFormCacheId(), $this->arrayToString($this->forms))); } } From afbaf13c5ece030e044c6d07f168d1f5f6f3838e Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" Date: Mon, 28 Oct 2024 12:04:30 +0100 Subject: [PATCH 2/3] Enhanced the `input` tag to include a disabled attribute (#601) --- .../fields/checkboxes/checkboxes.html.twig | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) mode change 100644 => 100755 templates/forms/fields/checkboxes/checkboxes.html.twig diff --git a/templates/forms/fields/checkboxes/checkboxes.html.twig b/templates/forms/fields/checkboxes/checkboxes.html.twig old mode 100644 new mode 100755 index e4920be..68253ef --- a/templates/forms/fields/checkboxes/checkboxes.html.twig +++ b/templates/forms/fields/checkboxes/checkboxes.html.twig @@ -12,30 +12,30 @@ {% set value = field.default|merge(value) %} {% endif %} - {% for key, text in field.options %} - - {% set id = field.id|default(field.name)|hyphenize ~ '-' ~ key %} - {% set name = field.use == 'keys' ? key : id %} - {% set val = field.use == 'keys' ? '1' : key %} - {% set checked = (field.use == 'keys' ? value[key] : key in value) %} - {% set help = (key in field.help_options|keys ? field.help_options[key] : false) %} -
- - + {% for key, text in field.options %} + {% set id = field.id|default(field.name)|hyphenize ~ '-' ~ key %} + {% set name = field.use == 'keys' ? key : id %} + {% set val = field.use == 'keys' ? '1' : key %} + {% set checked = (field.use == 'keys' ? value[key] : key in value) %} + {% set help = (key in field.help_options|keys ? field.help_options[key] : false) %} + {% set disabled = key in field.disabled_options %} + + + {% endfor %}
- {% endfor %} -{% endblock %} + +{% endblock %} \ No newline at end of file From 26fcdbe49b05ee9aaa528e3ffa36a59e5b113bab Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 28 Oct 2024 11:12:05 +0000 Subject: [PATCH 3/3] prepare for release --- CHANGELOG.md | 3 ++- blueprints.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95ee4ed..923e487 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # v7.4.2 -## mm/dd/2024 +## 10/28/2024 1. [](#improved) + * Enhanced the `input` tag to include a disabled attribute [$601](https://github.com/getgrav/grav-plugin-form/pull/601) * Updated logging methods to support Monolog2+ # v7.4.1 diff --git a/blueprints.yaml b/blueprints.yaml index 066ad5d..2afe86e 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,7 +1,7 @@ name: Form slug: form type: plugin -version: 7.4.1 +version: 7.4.2 description: Enables forms handling and processing icon: check-square author: