500 error when saving an address book with an empty description
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读 AddressBookType 中的 description 字段和 src/Entity/AddressBook.php 中的 setDescription 方法;将其与 CalendarInstance::setDescription 进行比较。复现描述为空时的保存操作,并检查现有的通讯录编辑测试。完成标准是保存空描述时不再返回 500 错误。
由索引模型根据 Issue 内容生成。
描述
Version: v5.5.0 (ghcr.io/tchapi/davis-standalone:5.5.0), MariaDB 11.8
Steps to reproduce
- In the dashboard, open a user's address book (e.g. the default one) for editing.
- Leave Description empty, change Display name.
- Click Save.
Expected: the address book is saved.
Actual: "500 Internal Server Error". Log:
request.CRITICAL: Uncaught PHP Exception Symfony\Component\PropertyAccess\Exception\InvalidTypeException: "Expected argument of type "string", "null" given at property path "description"." at PropertyAccessor.php line 198
[previous exception] TypeError: App\Entity\AddressBook::setDescription(): Argument #1 ($description) must be of type string, null given, called in /var/www/davis/vendor/symfony/property-access/PropertyAccessor.php on line 533 at /var/www/davis/src/Entity/AddressBook.php:115
Cause: in AddressBookType the description field is required => false, so an empty textarea is submitted as null, but AddressBook::setDescription(string $description) doesn't accept null. CalendarInstance::setDescription(?string $description) is already nullable, so calendars are not affected. The same signature is still present on main.
Workaround: enter any text in Description.
Possible fix: make the setter nullable (?string) like in CalendarInstance, or add 'empty_data' => '' to the description field in AddressBookType.
- 主要语言
- PHP
- 星标
- 756
- 派生
- 46
- 平均合并
- 2 天 5 小时
- 30 天内合并 PR
- 20
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
tchapi/davis 的其他 Issue
-
feature request
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
feature request
难度 5/5 一周以上 新手友好度 45/100
维护者通常 1 天内回复
-
feature request
难度 5/5 一周以上 新手友好度 30/100
tchapi/davis#231 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
feature request
难度 5/5 一周以上 新手友好度 35/100
tchapi/davis#228 · 1 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
5.0.2: add support for app keys?可能重新可做 @tchapi 于 565 天前认领,目前没有进行中的 PR。 未关闭feature request
tchapi/davis#183 · 2 条评论 · 2 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
customer-support needs-triage Platform(Default)
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
grokability/snipe-it#19767 ·
维护者通常 1 天内回复
-
[Code Quality] SfxDownloader extract path has no destination-writability pre-check for cached zips未关闭priority:low type:refactor
难度 2/5 1-3 小时 新手友好度 84/100
crazy-goat/workerman-bundle#1052 ·
维护者通常 1 天内回复
-
sync-en
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
sync-en
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 3 天内回复