Fix Update source for Monitor and Peripheral#23055
Fix Update source for Monitor and Peripheral#23055trasher merged 9 commits intoglpi-project:10.0/bugfixesfrom
Conversation
|
Liked to #23018 |
trasher
left a comment
There was a problem hiding this comment.
Tests are failing. In the other PR, I said that it could be a good idea to be more generic, if that does not break anything; and I'm afraid it's the case.
|
Yes, some tests failed because the autoupdatesystems_id field is attempting to insert a non-integer value into the database. The current approach is too generic Based on my understanding, all classes that extend In some cases, this is expected—for example, In other cases, however, this is not expected, as the field does exist in the database schema. At first glance, only the following classes (which extend
I therefore propose the following approach:
This approach would limit the scope of the changes while ensuring consistency and correctness. What do you think @trasher ? |
|
My idea would be to try handling that like the Basically, each item which have the field should automatically take main item one value; this value will never bet set in their data. |
|
Instead of creating another method just for that, I put it directly in handleLink because technically it's also part of link management. It okay like that @trasher ? |
Yes, that seems correct. |
|
Also, please fix tests and lint |
Co-authored-by: Johan Cwiklinski <[email protected]>
Co-authored-by: Johan Cwiklinski <[email protected]>
|
I've changed the tests (because this is no longer handled in prepare method). Currently, Monitor tests are OK, while Peripherals are not. In both cases we reach the new code part, and result is the same ( |
trasher
left a comment
There was a problem hiding this comment.
Seems OK now, just waiting for tests to finish

Checklist before requesting a review
Please delete options that are not relevant.
Description
Fixed the Update Source field not updating for monitors and peripherals when inventorying a computer.
Screenshots (if appropriate):