Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Error on exporting the error log

Abierto Apto para principiantes
#673 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
84/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
php
Área
backend

Línea de trabajo

Comienza con plugins/datainjection/front/clientinjection.form.php en la línea 75 y plugins/datainjection/inc/clientinjection.class.php en la línea 349; después, sigue readUploadedFile() y la solicitud de exportación en plugins/datainjection/front/export.csv.php. Verifica que el nombre del archivo subido siga disponible después del procesamiento y que al hacer clic en «Export the log» se descarguen las filas rechazadas como un CSV sin un HTTP 500.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Code of Conduct
  • I agree to follow this project's Code of Conduct
Is there an existing issue for this?
  • I have searched the existing issues
GLPI Version

11.0.9

Plugin version

2.15.11

Bug description

Importing a CSV through the client injection wizard loses the "Export the log" feature as soon as the import produces even one failed line.

What happens:

  1. I upload a valid CSV file to a model and run the injection. Here, PHP output a warning "Undefined array key "filename" at clientinjection.form.php line 75"
  2. Some rows fail (bad values, duplicates, whatever). The result screen correctly shows them and offers "Export the log" so I can fix the CSV and re-import.
  3. Clicking "Export the log" downloads nothing — the request just dies with a server error (HTTP 500 on front/export.csv.php). There is no way to recover the list of rejected lines; the only option is to re-run the whole import and read errors on screen, line by line.
Relevant log output
Logs during the upload:

[2026-09-22 12:52:54] glpi.WARNING:   *** Warning: Undefined array key "filename" at clientinjection.form.php line 75
   Backtrace :
   ...datainjection/front/clientinjection.form.php:75
   ...Glpi/Controller/LegacyFileLoadController.php:64 require()
   ./vendor/symfony/http-kernel/HttpKernel.php:181    Glpi\Controller\LegacyFileLoadController->__invoke()
   ./vendor/symfony/http-kernel/HttpKernel.php:76     Symfony\Component\HttpKernel\HttpKernel->handleRaw()
   ./vendor/symfony/http-kernel/Kernel.php:208        Symfony\Component\HttpKernel\HttpKernel->handle()
   ./src/Glpi/Kernel/Kernel.php:201                   Symfony\Component\HttpKernel\Kernel->handle()
   ./public/index.php:78                              Glpi\Kernel\Kernel->handle()

[2026-09-22 12:52:54] glpi.WARNING:   *** Warning: Trying to access array offset on null at clientinjection.form.php line 75
   Backtrace :
   ...datainjection/front/clientinjection.form.php:75
   ...Glpi/Controller/LegacyFileLoadController.php:64 require()
   ./vendor/symfony/http-kernel/HttpKernel.php:181    Glpi\Controller\LegacyFileLoadController->__invoke()
   ./vendor/symfony/http-kernel/HttpKernel.php:76     Symfony\Component\HttpKernel\HttpKernel->handleRaw()
   ./vendor/symfony/http-kernel/Kernel.php:208        Symfony\Component\HttpKernel\HttpKernel->handle()
   ./src/Glpi/Kernel/Kernel.php:201                   Symfony\Component\HttpKernel\Kernel->handle()
   ./public/index.php:78                              Glpi\Kernel\Kernel->handle()

Logs of the error obtained by clicking "Export the log"

[2026-09-22 12:55:46] glpi.WARNING:   *** Warning: fopen(/var/glpi/files/_plugins/datainjection/): Failed to open stream: Is a directory at filesystem.php line 399
   Backtrace :
   ...ngmachine/safe/generated/8.2/filesystem.php:399
   ...datainjection/inc/clientinjection.class.php:349 Safe\fopen()
   ./plugins/datainjection/front/export.csv.php:33    PluginDatainjectionClientInjection::exportErrorsInCSV()
   ...Glpi/Controller/LegacyFileLoadController.php:64 require()
   ./vendor/symfony/http-kernel/HttpKernel.php:181    Glpi\Controller\LegacyFileLoadController->__invoke()
   ./vendor/symfony/http-kernel/HttpKernel.php:76     Symfony\Component\HttpKernel\HttpKernel->handleRaw()
   ./vendor/symfony/http-kernel/Kernel.php:208        Symfony\Component\HttpKernel\HttpKernel->handle()
   ./src/Glpi/Kernel/Kernel.php:201                   Symfony\Component\HttpKernel\Kernel->handle()
   ./public/index.php:78                              Glpi\Kernel\Kernel->handle()

[2026-09-22 12:55:46] glpi.CRITICAL:   *** Uncaught PHP Exception Safe\Exceptions\FilesystemException: "An error occurred" at FilesystemException.php line 9
   Backtrace :
   .../generated/Exceptions/FilesystemException.php:9
   ...ngmachine/safe/generated/8.2/filesystem.php:402 Safe\Exceptions\FilesystemException::createFromPhpError()
   ...datainjection/inc/clientinjection.class.php:349 Safe\fopen()
   ./plugins/datainjection/front/export.csv.php:33    PluginDatainjectionClientInjection::exportErrorsInCSV()
   ...Glpi/Controller/LegacyFileLoadController.php:64 require()
   ./vendor/symfony/http-kernel/HttpKernel.php:181    Glpi\Controller\LegacyFileLoadController->__invoke()
   ./vendor/symfony/http-kernel/HttpKernel.php:76     Symfony\Component\HttpKernel\HttpKernel->handleRaw()
   ./vendor/symfony/http-kernel/Kernel.php:208        Symfony\Component\HttpKernel\HttpKernel->handle()
   ./src/Glpi/Kernel/Kernel.php:201                   Symfony\Component\HttpKernel\Kernel->handle()
   ./public/index.php:78                              Glpi\Kernel\Kernel->handle()
Page URL

error occurs on /plugins/datainjection/front/export.csv.php (/plugins/datainjection/front/clientinjection.form.php on upload step outputs the warning)

Steps To reproduce
  1. Go to Administration > Data injection (client injection), pick a ready-to-use CSV model.
  2. Upload a valid CSV matching the model (with at least one row that will fail injection, so error lines exist).
  3. Check the GLPI PHP error log → "Undefined array key "filename"" at clientinjection.form.php line 75 (file_name stored as null in session).
  4. Run the injection, then click "Export the log".
  5. See error: fopen(.../files/plugins/datainjection/): Failed to open stream: Is a directory → uncaught TypeError in fputcsv() → HTTP 500, no CSV download.
Your GLPI setup information

No response

Anything else?

Root cause is the unset($_FILES['filename']); in readUploadedFile() combined with the re-read at clientinjection.form.php:75.

Suggested fix: capture the name before the unset and pass it back, e.g. in clientinjection.form.php do $uploaded_filename = $_FILES['filename']['name']; before processUploadedFile(), then $_SESSION['datainjection']['file_name'] = $uploaded_filename; — or have readUploadedFile() return the original name (it already captures it in $original_filename internally) instead of reaching into $_FILES again.

Lenguaje dominante
PHP
Estrellas
76
Forks
62
Merge medio
13 h 53 min
PR fusionados (30 d)
12

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pluginsGLPI/datainjection

Todos los issues de pluginsGLPI/datainjection

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.