Lowercase `post` media uploads skip the draft post ID strip
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 70/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, wordpress
- Área
- backend
Línea de trabajo
Read src/utils/api-fetch.js and trace middleware registration order, especially stripDraftPostIdMiddleware and the wrapper around core's mediaUploadMiddleware. Check the existing tests for api-fetch middleware behavior, then verify that lowercase method: 'post' is uppercased before the draft ID is stripped and that the wrapper's duplicate conversion can be removed. Done means the request no longer sends post=-1.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
A media upload sent with a lowercase method: 'post' keeps the placeholder post=-1 field. stripDraftPostIdMiddleware is meant to remove it before the request reaches WordPress.
Follow-up from #594. The behavior is the same on trunk, so it wasn't introduced there.
What happens
stripDraftPostIdMiddleware in src/utils/api-fetch.js only acts when options.method === 'POST'. A plugin calling apiFetch( { path: '/wp/v2/media', method: 'post', body } ) skips it, and WordPress receives post=-1.
Gutenberg's own uploads send POST, so this only affects third-party code.
Suggested fix
Uppercase options.method in a small middleware registered so it runs before every other GutenbergKit middleware. #594 already uppercases the method inside its wrapper around core's mediaUploadMiddleware (fcf8f0300), but that wrapper runs after stripDraftPostIdMiddleware. Moving the uppercasing up would cover both, and the wrapper's copy could then be removed.
fetch uppercases the standard methods itself, so nothing further down sees a difference.
- Lenguaje dominante
- JavaScript
- Estrellas
- 29
- Forks
- 6
- Merge medio
- 2 d 1 h
- PR fusionados (30 d)
- 76
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 wordpress-mobile/GutenbergKit
-
[Type] Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
wordpress-mobile/GutenbergKit#940 ·
Los mantenedores suelen responder en 1 día
-
[Type] Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
wordpress-mobile/GutenbergKit#884 ·
Los mantenedores suelen responder en 1 día
-
[Type] Bug Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
wordpress-mobile/GutenbergKit#847 ·
Los mantenedores suelen responder en 1 día
-
[Type] Bug iOS
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
wordpress-mobile/GutenbergKit#846 ·
Los mantenedores suelen responder en 1 día
-
[Type] Bug [Type] Code Quality iOS
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
wordpress-mobile/GutenbergKit#668 ·
Los mantenedores suelen responder en 1 día
Todos los issues de wordpress-mobile/GutenbergKit
Issues similares
-
Remove: Tele Azul LogoAbiertocheck:passed logos:remove
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
intuitem/ciso-assistant-community#5380 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
TarteelAI/quranic-universal-library#1111 ·
Los mantenedores suelen responder en 1 día
-
area:ryoku type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
feedback simulation workshop
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
githubnext/gh-aw-workshop#6094 ·
Los mantenedores suelen responder en 1 día