Conversation
MailFieldsTable::validationDefault() に BcValidation::reserved() による 予約語チェックを追加。CustomFieldsTable と同様のバリデーションパターンを適用。 - field_name に reserved バリデーションルールを追加 - BcValidation プロバイダー (bc) を登録 - ユニットテストを追加(select, insert, update などの予約語をテスト) Co-authored-by: tera <teratai3@users.noreply.github.com>
|
@cursor review |
|
@cursor review
|
| */ | ||
| public function validationDefault(Validator $validator): Validator | ||
| { | ||
| $validator->setProvider('bc', 'BaserCore\Model\Validation\BcValidation'); |
There was a problem hiding this comment.
Redundant provider registration already set at bootstrap
Low Severity
The setProvider('bc', 'BaserCore\Model\Validation\BcValidation') call is redundant — the bc provider is already registered as a default provider via Validator::addDefaultProvider('bc', ...) in plugins/baser-core/config/bootstrap.php. Notably, the CustomFieldsTable that this PR says it's modeled after does not include this explicit setProvider call yet uses 'provider' => 'bc' for its reserved rule without issue. This inconsistency with the stated reference implementation adds unnecessary code.
|
@cursor review
|
|
@cursor review デフォルトバリデーションプロバイダーで起動時に呼出されているので、今回の修正では明示する必要がない可能性を考えてください |
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |


MailFieldsTable::validationDefault() に BcValidation::reserved() による 予約語チェックを追加。CustomFieldsTable と同様のバリデーションパターンを適用。
Note
Low Risk
Adds an additional validation rule on
MailFieldsTablethat can block previously-acceptedfield_namevalues (e.g.,select,insert,update), but the change is localized to input validation and covered by new unit tests.Overview
Prevents registering mail field
field_namevalues that are database/system reserved words by wiringBaserCore\Model\Validation\BcValidation::reserved()intoMailFieldsTable::validationDefault()(including registering thebcvalidator provider).Adds unit coverage to ensure reserved words like
select/insert/updateare rejected with the new error message, while normal names still pass.Written by Cursor Bugbot for commit 9e049af. This will update automatically on new commits. Configure here.