Skip to content

Conversation

@Lainow
Copy link
Contributor

@Lainow Lainow commented Dec 19, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

  • It fixes !39739
  • Here is a brief description of what this PR does

Screenshots (if appropriate):

On the model page
image

On the device page when a model is linked
image

@Lainow Lainow self-assigned this Dec 19, 2025
@Lainow Lainow requested review from Rom1-B and stonebuzz December 19, 2025 13:30
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
Copy link
Contributor

@AdrienClairembault AdrienClairembault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for me besides the unrelated illustration field being deleted 👍

Also, is "Rack pictures" the correct label here? This doesn't seem related to racks.

Image

Copy link
Contributor

@stonebuzz stonebuzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After adding the model’s rear and front images, it is no longer possible to add an image (and vice versa).

When adding a rear or front image here…

image

It is no longer possible to add additional images.

image

Another point :
Deleting a single image does not work (deleting both at the same time works).

@cedric-anne cedric-anne added this to the 12.0.0 milestone Jan 5, 2026
@Lainow Lainow requested a review from stonebuzz January 5, 2026 10:07
@Lainow Lainow requested a review from stonebuzz January 5, 2026 11:03
@stonebuzz
Copy link
Contributor

@Lainow,

To maintain consistency with other models that include images, we need to keep the "Other Pictures" field.

Example for computer models:

image

Example for graphics card models (implementation in progress):

image

Another point:

When uploading images while adding a graphics card model, some images are not displayed correctly or missing entirely.

Here are the relevant PHP logs from GLPI:

[2026-01-05 13:07:12] glpi.INFO:   *** Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at Toolbox.php line 591
  Backtrace :
  ./src/Toolbox.php:591                              
  ./front/document.send.php:115                      Toolbox::getFileAsResponse()
  ...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:197        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:70                              Symfony\Component\HttpKernel\Kernel->handle()

[2026-01-05 13:07:12] glpi.INFO:   *** Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at Toolbox.php line 597
  Backtrace :
  ./src/Toolbox.php:597                              
  ./front/document.send.php:115                      Toolbox::getFileAsResponse()
  ...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:197        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:70                              Symfony\Component\HttpKernel\Kernel->handle()

[2026-01-05 13:07:12] glpi.WARNING:   *** User Warning: Unexpected output detected in `./front/document.send.php`. at LegacyFileLoadController.php line 80
  Backtrace :
  ...Glpi/Controller/LegacyFileLoadController.php:80 
  ./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:197        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:70                              Symfony\Component\HttpKernel\Kernel->handle()

Tested with

images
nvidia_geforce_gtx_750_ti_01_thumb

@Lainow Lainow force-pushed the feat-add-pictures-to-models branch from 10859f4 to c50b6c1 Compare January 6, 2026 08:51
@Lainow
Copy link
Contributor Author

Lainow commented Jan 6, 2026

When uploading images while adding a graphics card model, some images are not displayed correctly or missing entirely.

Here are the relevant PHP logs from GLPI:

[2026-01-05 13:07:12] glpi.INFO:   *** Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at Toolbox.php line 591
  Backtrace :
  ./src/Toolbox.php:591                              
  ./front/document.send.php:115                      Toolbox::getFileAsResponse()
  ...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:197        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:70                              Symfony\Component\HttpKernel\Kernel->handle()

[2026-01-05 13:07:12] glpi.INFO:   *** Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at Toolbox.php line 597
  Backtrace :
  ./src/Toolbox.php:597                              
  ./front/document.send.php:115                      Toolbox::getFileAsResponse()
  ...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:197        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:70                              Symfony\Component\HttpKernel\Kernel->handle()

[2026-01-05 13:07:12] glpi.WARNING:   *** User Warning: Unexpected output detected in `./front/document.send.php`. at LegacyFileLoadController.php line 80
  Backtrace :
  ...Glpi/Controller/LegacyFileLoadController.php:80 
  ./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:197        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:70                              Symfony\Component\HttpKernel\Kernel->handle()

I tested it with the images you gave me, but I don't have any problems. I also tried it with other images and had no problems.
image

@stonebuzz
Copy link
Contributor

Perhaps the image on my machine is causing the issue (here it was uploaded via GitHub).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants