peer_reviewed_article: Saving without the author, title or image field passes null to the DOM (PHP 9.0)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start in system/datatypes/peer_reviewed_article.php at editAction(), around lines 717–725, and compare the optional field handling in festival.php. Check how dataFor() behaves when author, title, or featured image is absent, then confirm saves with those fields omitted no longer pass null to DOM methods. Pull request #602 is already open for this issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem. peer_reviewed_article::editAction() passes three form values straight to DOM methods:
system/datatypes/peer_reviewed_article.php:717-718:setAttribute(self::FIELD_NAME_AUTHOR, $form->dataFor(self::FIELD_NAME_AUTHOR)):720:->setText($form->dataFor(self::FIELD_NAME_TITLE)):725:->getOrCreate(self::FIELD_NAME_FEATURED_IMAGE)->setText($form->dataFor(self::FIELD_NAME_FEATURED_IMAGE))
dataFor() returns null for a field that is not in the post (for the featured image: when neither featured_image nor file_shadow_featured_image is posted). Passing null to a string parameter of an internal function is deprecated since PHP 8.1 and becomes a TypeError in PHP 9.0 (RFC: Deprecate passing null to non-nullable arguments of internal functions). On 9.0 such a save ends in a fatal error instead of storing empty values.
Messages on main (d97ab7b), PHP 8.2 and 8.5, for one post to <article>/edit with command save and only text, excerpt, method and sources:
Deprecated: DOMElement::setAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in system/datatypes/peer_reviewed_article.php on line 718
Deprecated: DOMDocument::createTextNode(): Passing null to parameter #1 ($data) of type string is deprecated in system/core/database.php on line 488 (setText(), called from line 720 and 725)
The edit form in a browser always posts these fields (the shadow field of the image is added by HTMLForm::addFileShadowValueField()), so this hits a client that posts fewer fields, such as a script or an older form, not the normal editor. PHP 8.6.0RC4 runs the same code; its Apache image does not show the deprecation in the container log.
This is the same kind of fault as #408 (document.php:566), #588 (festival phone) and the festival website field in #559, in a place those do not cover.
Proposed fix (a suggestion and a starting point): give dataFor() the default '' for these three fields, as festival.php does for its optional fields. Works unchanged on PHP 8.2 up to 8.5.
🤖 Generated with Claude Code
- Ngôn ngữ chính
- JavaScript
- Star
- 5
- Fork
- 9
- Merge trung bình
- 18 giờ 7 phút
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PlanBCode/hypha
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Impact: Medium Level: Easy Type: Bug Value: Users
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Impact: Low Level: Easy Type: Bug Value: Coders
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
PlanBCode/hypha#586 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của PlanBCode/hypha
Issue tương tự
-
ai-driven-fuzzing bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
linagora/cozy-client#1777 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[guide] AGENTS.md claims the coverage gate, e2e and full lint run on every PR after ADR 0011 focused validationCó thể đã có người làm @hivecommons-hive đã nhận hôm nay. Đang mởagent/guide documentation hive/claimed-by-guide stage/040-covered-by-pr
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 81/100
cncf/endusers#2006 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
check:passed feeds:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 4 ngày
-
CMS video element: "CmsVideoPlugin" sets `volume = 0`, so videos cannot be unmuted on Android ChromeĐang mởneeds-triage Platform(Default)
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
all-contributors/cli#587 ·
Maintainer thường phản hồi trong vòng 1 ngày