peer_reviewed_article: Saving without the author, title or image field passes null to the DOM (PHP 9.0)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- JavaScript
- Estrellas
- 5
- Forks
- 9
- Merge medio
- 18 h 49 min
- PR fusionados (30 d)
- 13
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PlanBCode/hypha
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Impact: Medium Level: Easy Type: Bug Value: Users
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Impact: Low Level: Easy Type: Bug Value: Coders
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
PlanBCode/hypha#586 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de PlanBCode/hypha
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 13 días
-
Slack: DM thread replies sent with "Also send to..." never reach the agentPosiblemente ocupada @roboeve la tomó hoy. Abiertobug channel:slack p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
vercel/eve#5774 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Android: keyboard height remains stale when IME disappears without a closing animationPosiblemente ocupada @jaxnnux la tomó hoy. AbiertoMissing info Missing repro Platform: Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
software-mansion/react-native-reanimated#11106 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement version-minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
cuttle-cards/cuttle#1467 ·
Los mantenedores suelen responder en 1 día
-
2026-11 bug good first issue gsoc-2027 project: mockuper
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
alphaonelabs/website#1147 · 1 comentario ·
Los mantenedores suelen responder en 1 día