From 330c28691040472332ff7bc6ad77539eb74b30ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kud=C4=9Blka?= Date: Sun, 15 Jun 2025 20:54:27 +0200 Subject: [PATCH 1/4] Updates doctrine-components dependency Updates the doctrine-components dependency to the latest major version. This change removes the previous range constraint and ensures compatibility with newer features and bug fixes. Also updates namespace of QueryObject class. --- composer.json | 2 +- src/Components/AjaxSelect/Entities/AbstractEntity.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b78d4b6..2416ad3 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "nette/di": "^3.0", "nette/utils": "^3.0 | ^4.0", "nette/application": "*", - "adt/doctrine-components": "^2.9|^3.0" + "adt/doctrine-components": "^3.0" }, "autoload": { "psr-4": { diff --git a/src/Components/AjaxSelect/Entities/AbstractEntity.php b/src/Components/AjaxSelect/Entities/AbstractEntity.php index 1bad32e..4f637f8 100644 --- a/src/Components/AjaxSelect/Entities/AbstractEntity.php +++ b/src/Components/AjaxSelect/Entities/AbstractEntity.php @@ -3,7 +3,7 @@ namespace ADT\Components\AjaxSelect\Entities; use ADT\Components\AjaxSelect; -use ADT\DoctrineComponents\QueryObject; +use ADT\DoctrineComponents\QueryObject\QueryObject; use Nette\Application\UI\Presenter; use Nette\SmartObject; From 0ae2a4de5d6e998f00b74a97d477dce71f133af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kud=C4=9Blka?= Date: Sat, 31 Jan 2026 08:36:14 +0100 Subject: [PATCH 2/4] Updates dependencies and form validation Updates the dependencies to PHP 8.3 and a new forms component. Uses validated form values instead of all values when formatting and hydrating values, improving data handling and security. --- composer.json | 4 ++-- src/Components/AjaxSelect/Entities/AbstractEntity.php | 2 +- src/Components/AjaxSelect/Traits/AjaxServiceControlTrait.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 2416ad3..432a857 100644 --- a/composer.json +++ b/composer.json @@ -4,8 +4,8 @@ "type": "library", "license": ["MIT", "BSD-3-Clause", "GPL-2.0", "GPL-3.0"], "require": { - "php": ">=7.1", - "nette/forms": "^3.0", + "php": ">=8.3", + "adt/nette-forms-components": "^2.3", "nette/di": "^3.0", "nette/utils": "^3.0 | ^4.0", "nette/application": "*", diff --git a/src/Components/AjaxSelect/Entities/AbstractEntity.php b/src/Components/AjaxSelect/Entities/AbstractEntity.php index 4f637f8..2bd32cd 100644 --- a/src/Components/AjaxSelect/Entities/AbstractEntity.php +++ b/src/Components/AjaxSelect/Entities/AbstractEntity.php @@ -201,7 +201,7 @@ public function done() { is_array($controlValue) ? $controlValue : [ $controlValue ], - $control->getForm()->getValues('array') + $control->getForm()->getValidatedValues('array') ) : [], 'queryParam' => static::OPTION_QUERY, diff --git a/src/Components/AjaxSelect/Traits/AjaxServiceControlTrait.php b/src/Components/AjaxSelect/Traits/AjaxServiceControlTrait.php index f323d38..4e7f639 100644 --- a/src/Components/AjaxSelect/Traits/AjaxServiceControlTrait.php +++ b/src/Components/AjaxSelect/Traits/AjaxServiceControlTrait.php @@ -53,7 +53,7 @@ protected function processValues($values) { $validValues = array_merge($validValues, $invalidValues); } - $validItems = $this->getAjaxEntity()->formatValues($this->getAjaxEntity()->hydrateValues($validValues, $this->getForm()->getValues('array'))); + $validItems = $this->getAjaxEntity()->formatValues($this->getAjaxEntity()->hydrateValues($validValues, $this->getForm()->getValidatedValues('array'))); // add to list of valid values $this->setItems($this->getItems() + $validItems); From d0fd9e1e1c5b649579a720d8335bc073131da9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kud=C4=9Blka?= Date: Wed, 24 Jun 2026 08:58:32 +0200 Subject: [PATCH 3/4] Introduce Nette Forms and improve type consistency Adds the `nette/forms` dependency to expand form capabilities. Updates `getHttpData` method signature with type hints for clarity and consistency. --- composer.json | 5 +++-- src/Components/AjaxSelect/Traits/InvalidSetValueTrait.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 432a857..38a0b26 100644 --- a/composer.json +++ b/composer.json @@ -9,8 +9,9 @@ "nette/di": "^3.0", "nette/utils": "^3.0 | ^4.0", "nette/application": "*", - "adt/doctrine-components": "^3.0" - }, + "adt/doctrine-components": "^3.0", + "nette/forms": "^3.3" + }, "autoload": { "psr-4": { "ADT\\": "src/" diff --git a/src/Components/AjaxSelect/Traits/InvalidSetValueTrait.php b/src/Components/AjaxSelect/Traits/InvalidSetValueTrait.php index e2f5afe..6f75a61 100644 --- a/src/Components/AjaxSelect/Traits/InvalidSetValueTrait.php +++ b/src/Components/AjaxSelect/Traits/InvalidSetValueTrait.php @@ -35,7 +35,7 @@ public function setInvalidValueMode($mode) { return $this; } - protected abstract function getHttpData($type, ?string $htmlTail = NULL); + protected abstract function getHttpData(int $type, ?string $htmlTail = NULL): mixed; protected abstract function isDisabled(); /** From 4316fe6e15c2192644ff0ce1e3d8e1c9ac716e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kud=C4=9Blka?= Date: Wed, 24 Jun 2026 09:05:31 +0200 Subject: [PATCH 4/4] Pin `nette/forms` dependency to `3.2.x` series Restricts the allowed versions to `^3.2.9` to prevent potential compatibility issues with `3.3.x` releases. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 38a0b26..80c71a3 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "nette/utils": "^3.0 | ^4.0", "nette/application": "*", "adt/doctrine-components": "^3.0", - "nette/forms": "^3.3" + "nette/forms": "^3.2.9" }, "autoload": { "psr-4": {