diff --git a/CHANGELOG.md b/CHANGELOG.md index 44896bd..923e487 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v7.4.2 +## 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 ## 10/22/2024 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: 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))); } } 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