-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Business rule for assets : action to add a group in charge now supports multiple groups. #21668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 11.0/bugfixes
Are you sure you want to change the base?
Business rule for assets : action to add a group in charge now supports multiple groups. #21668
Conversation
|
Shouldn't the action for "Group" be changed in addition to "Group in charge"? |
good question. And, you are right, we can also add the possibility to add multiple groups for |
Yes. It is just the default/regular group association type.
The only issue I forsee is confusion around the |
|
|
cedric-anne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The append action seems to remove the existing groups, instead of appending new groups to existing groups.
|
ok, I'll check by adding a test. |
This was the case. I added a test then fix the code. |
|
(sorry for the merge, I resolved the conflict in GitHub) |
9e9c7ef to
7afb679
Compare
cedric-anne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is still an issue. Existing values are correctly preserved, but if I tried to manually add a group in the form, it is dropped when the "append" rule is executed.
96b6ae6 to
93a0131
Compare
AdrienClairembault
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E2E failure is related, I reproduce it with make cypress c="--spec tests/cypress/e2e/form/destination_config_fields/requester.cy.js"
The 500 error from the server logs:
[2025-11-14 08:49:37] glpi.CRITICAL: *** Uncaught PHP Exception TypeError: "array_merge(): Argument #2 must be of type array, int given" at CommonDBTM.php line 5776
Backtrace :
./src/CommonDBTM.php:5776
./src/CommonDBTM.php:5776 array_merge()
./src/CommonDBTM.php:1353 CommonDBTM->assetBusinessRules()
./src/Glpi/Api/API.php:1894 CommonDBTM->add()
./src/Glpi/Api/APIRest.php:344 Glpi\Api\API->createItems()
./src/Glpi/Controller/ApiRestController.php:59 Glpi\Api\APIRest->call()
./vendor/symfony/http-kernel/HttpKernel.php:101 Glpi\Controller\ApiRestController->{closure:Glpi\Controller\ApiRestController::__invoke():57}()
...ymfony/http-foundation/StreamedResponse.php:106 Symfony\Component\HttpKernel\HttpKernel::{closure:Symfony\Component\HttpKernel\HttpKernel::handle():98}()
./vendor/symfony/http-foundation/Response.php:423 Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
./src/Glpi/Kernel/Kernel.php:295 Symfony\Component\HttpFoundation\Response->send()
./public/index.php:72 Glpi\Kernel\Kernel->sendResponse()
It seems to be this API payload that trigger the errors:
I think you missed that groups_id can be an int instead of an array (as this API call work properly and set the correct groups on the bugfixes branch).
…ts multiple groups.
…stead of an array of int
6c2aca8 to
d3a23e5
Compare
… of an array of int
Co-authored-by: Adrien Clairembault <[email protected]>

Checklist before requesting a review
Please delete options that are not relevant.
Description