From fe514c6529954f2ccbb4ceba229ace6915dd40a6 Mon Sep 17 00:00:00 2001 From: Iwona Just Date: Fri, 9 Feb 2024 07:54:38 +0000 Subject: [PATCH 1/3] report newLocation error in asset slideout --- src/elements/Asset.php | 3 +++ src/helpers/Cp.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/elements/Asset.php b/src/elements/Asset.php index 6aac6001e35..3435fdca5c7 100644 --- a/src/elements/Asset.php +++ b/src/elements/Asset.php @@ -2674,6 +2674,9 @@ protected function metaFieldsHtml(bool $static): string 'required' => true, 'class' => ['text', 'filename'], 'disabled' => $static, + 'data' => [ + 'attribute' => 'newLocation', + ], ]), parent::metaFieldsHtml($static), ]); diff --git a/src/helpers/Cp.php b/src/helpers/Cp.php index 4d2a0ab60c7..8800143fab0 100644 --- a/src/helpers/Cp.php +++ b/src/helpers/Cp.php @@ -777,7 +777,7 @@ public static function fieldHtml(string $input, array $config = []): string 'class' => $fieldClass, 'id' => $fieldId, 'data' => [ - 'attribute' => $attribute, + 'attribute' => $config['data']['attribute'] ?? $attribute, ], ], $config['fieldAttributes'] ?? [] From 5e14cef6346752d7d80a33068d1305050ee7e847 Mon Sep 17 00:00:00 2001 From: Iwona Just Date: Mon, 12 Feb 2024 08:35:56 +0000 Subject: [PATCH 2/3] different approach --- src/elements/Asset.php | 4 +--- src/helpers/Cp.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/elements/Asset.php b/src/elements/Asset.php index 3435fdca5c7..4bed2f5f070 100644 --- a/src/elements/Asset.php +++ b/src/elements/Asset.php @@ -2666,6 +2666,7 @@ protected function metaFieldsHtml(bool $static): string return implode("\n", [ Cp::textFieldHtml([ 'label' => Craft::t('app', 'Filename'), + 'attribute' => 'newLocation', 'id' => 'new-filename', 'name' => 'newFilename', 'value' => $this->_filename, @@ -2674,9 +2675,6 @@ protected function metaFieldsHtml(bool $static): string 'required' => true, 'class' => ['text', 'filename'], 'disabled' => $static, - 'data' => [ - 'attribute' => 'newLocation', - ], ]), parent::metaFieldsHtml($static), ]); diff --git a/src/helpers/Cp.php b/src/helpers/Cp.php index 8800143fab0..4d2a0ab60c7 100644 --- a/src/helpers/Cp.php +++ b/src/helpers/Cp.php @@ -777,7 +777,7 @@ public static function fieldHtml(string $input, array $config = []): string 'class' => $fieldClass, 'id' => $fieldId, 'data' => [ - 'attribute' => $config['data']['attribute'] ?? $attribute, + 'attribute' => $attribute, ], ], $config['fieldAttributes'] ?? [] From 99ba1f10006808758940990917e9f54cbf6142da Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Tue, 13 Feb 2024 11:14:15 -0800 Subject: [PATCH 3/3] Release note [ci skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a97dc84d8fd..42cfde39db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed a bug where read/write splitting was always getting disabled for GraphQL POST requests. ([#14324](https://github.com/craftcms/cms/issues/14324)) - Fixed a bug where GraphQL schema edit pages could include empty category headings. +- Fixed a bug where asset slideouts weren’t showing validation errors on the Filename field. ([#14329](https://github.com/craftcms/cms/issues/14329)) ## 4.7.2.1 - 2024-02-08