[プラグイン共通] 投稿通知の件名が未設定の場合に500エラーが発生する問題を修正しました - #2225
Merged
Conversation
- BucketsMail::getFormattedSubject()メソッドでnull/空文字列の場合にデフォルト値を返すよう修正 - UserPluginBase::saveBucketsMailsメソッドに動的な件名フィールドバリデーションを追加 - メール設定画面の件名フィールドに「必須」バッジを追加してユーザビリティを向上 修正内容: - app/Models/Common/BucketsMail.php: getFormattedSubject()でnull許容とデフォルト値設定 - app/Plugins/User/UserPluginBase.php: 有効なメール機能に応じた動的バリデーション追加 - resources/views/plugins/common/frame_edit_mails.blade.php: 件名フィールドに必須バッジ追加 関連Issue: #2224 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- null値が渡された場合のテストケースを追加 - 空文字列が渡された場合のテストケースを追加 - 両方とも「【件名未設定】」がデフォルト値として返されることを確認 追加テストメソッド: - testGetFormattedSubjectWithNull(): null値のテスト - testGetFormattedSubjectWithEmptyString(): 空文字列のテスト 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
ブログプラグインなどで、メール設定において「投稿通知の件名」を空の状態で記事を新規登録すると500エラーが発生する問題を修正しました。
修正内容
1. BucketsMail::getFormattedSubject()メソッドの修正
string < /dev/null | null)2. UserPluginBase::saveBucketsMailsメソッドの修正
useBucketMailMethods()で有効なメール機能を動的に判定3. メール設定画面の改善
4. テストケースの追加
BucketsMailTest::testGetFormattedSubjectWithNull(): null値処理のテストBucketsMailTest::testGetFormattedSubjectWithEmptyString(): 空文字列処理のテスト検討事項
本文の必須化について
メール通知の本文についても必須にすることを検討しましたが、以下の理由により実装を見送りました:
nullableとして設計されており、設計思想との整合性件名に
[[title]]や[[url]]の埋め込みタグを活用することで、本文なしでも十分な通知が可能と判断しました。影響範囲
テスト手順
テスト実行
関連Issue
Closes #2224
レビュー観点
useBucketMailMethods()に応じて適切に動作するか