From db17c890c5ddbf02679ade79c57dae038bd58c15 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 9 Apr 2020 14:39:25 -0400 Subject: [PATCH] - Forced form's name when one is given to a contact (will make sure the good form has been passed) --- src/Common/UiElement.php | 4 ++-- src/Method/FormHandler.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Common/UiElement.php b/src/Common/UiElement.php index a869fdc..fb4596a 100644 --- a/src/Common/UiElement.php +++ b/src/Common/UiElement.php @@ -346,7 +346,7 @@ class UiElement implements \ArrayAccess, \Iterator, \JsonSerializable { public function jsonSerialize() { return [ 'tag' => $this->tag, - 'attr' => $this->attr, + 'attr' => $this->attributes, 'childs' => $this->childs, 'options' => $this->options, ]; @@ -404,7 +404,7 @@ class UiElement implements \ArrayAccess, \Iterator, \JsonSerializable { return ! in_array(key($this->childs), [ NULL, FALSE ], true); } - public static function is_node($obj) : bool + public static function isNode($obj) : bool { return $obj instanceof UiElement; } diff --git a/src/Method/FormHandler.php b/src/Method/FormHandler.php index 64acb60..ebc1a52 100644 --- a/src/Method/FormHandler.php +++ b/src/Method/FormHandler.php @@ -34,7 +34,7 @@ class FormHandler { { if ( false !== $this->context->formSent = $this->sent ) { if ( $this->context->formName ?? false ) { - $this->context->formSent = (bool) ( $this->request->getParsedBody()['picea-ui-form'][$this->context->formName] ?? false ); + $this->sent = $this->context->formSent = (bool) ( $this->request->getParsedBody()['picea-ui-form'][$this->context->formName] ?? false ); } } }