Skip to content

Conversation

@CUhamachi
Copy link
Contributor

#4279
対応しました。
エラーメッセージも追加しています。
ご確認よろしくお願いします。

スクリーンショット 2025-11-14 16 42 28

Copilot AI review requested due to automatic review settings November 14, 2025 07:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

アクセス制限設定のルールフィールドに必須バリデーションを追加し、適切なエラーメッセージを表示するようにする修正です。

  • PermissionGroupsTable にルール(permissions)フィールドの必須バリデーションを追加
  • フォームテンプレートにエラーメッセージ表示用のコードを追加

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
plugins/baser-core/src/Model/Table/PermissionGroupsTable.php ルール(permissions)フィールドに必須バリデーションとエラーメッセージを追加
plugins/bc-admin-third/templates/Admin/element/PermissionGroups/form.php エラーメッセージを表示するためのコードを追加

->notEmptyString('name', __d('baser_core', 'ルールグループ名を入力してください。'));

$validator
->requirePresence('permissions', 'update', __d('baser_core', 'ルールが設定されていません。'))
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requirePresence の第2引数が 'update' になっていますが、これでは新規作成時('create')にバリデーションが実行されません。必須項目であれば 'create' または true に変更する必要があります。現在の実装では、新規作成時にルールが未設定でも保存できてしまう可能性があります。

Suggested change
->requirePresence('permissions', 'update', __d('baser_core', 'ルールが設定されていません。'))
->requirePresence('permissions', true, __d('baser_core', 'ルールが設定されていません。'))

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@CUhamachi CUhamachi Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新規作成時はルールの欄が無い為、updateにしています。

【新規作成時の画面】
スクリーンショット 2025-11-14 16 49 38

@ryuring
Copy link
Collaborator

ryuring commented Nov 16, 2025

@CUhamachi 対応ありがとうございます。
ただ、こちらの件、必須マークが存在するのが間違いのようです。
バリデーションはなしで、必須マークを外してもらえると助かります。

@CUhamachi
Copy link
Contributor Author

バリデーションと必須マークを外しました。
ご確認よろしくお願いいたします。
cap

@ryuring
Copy link
Collaborator

ryuring commented Nov 17, 2025

@CUhamachi ありがとうございますmm

@ryuring ryuring merged commit 44da541 into baserproject:5.2.x Nov 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants