Repository navigation
Replace legacy entrypoints with controllers - #380
Merged
Merged
Conversation
btry
force-pushed
the
feature/use_controllers
branch
from
October 9, 2026 11:08
299beb2 to
9bcd9c2
Compare
Rom1-B
reviewed
Oct 12, 2026
Rom1-B
left a comment
Contributor
There was a problem hiding this comment.
Can you add functional tests for both controllers, at least the rights checks on reset and calculate?
| case $request->request->has('calculate'): | ||
| return $this->calculate($request); | ||
| default: | ||
| throw new Exception('Method not allowed'); |
Contributor
There was a problem hiding this comment.
Unknown action returns a 500; a 400 fits better.
Suggested change
| throw new Exception('Method not allowed'); | |
| throw new BadRequestHttpException(); |
| case $request->request->has('calculate'): | ||
| return $this->calculate($request); | ||
| default: | ||
| throw new Exception('Method not allowed', 405); |
Contributor
There was a problem hiding this comment.
Same as in EmbodiedImpactController.
Suggested change
| throw new Exception('Method not allowed', 405); | |
| throw new BadRequestHttpException(); |
Comment on lines
+62
to
+65
| // if method is GET, then throw an exception, workaround bug in GLPI up to 11.0.7 | ||
| if ($request->isMethod('GET')) { | ||
| return new Response('', 403); | ||
| } |
Contributor
There was a problem hiding this comment.
Is this workaround still needed with GLPI >= 12.0.0? If not, methods: ['POST'] would be enough; otherwise the comment says "throw" but the code returns a 403.
Collaborator
Author
There was a problem hiding this comment.
Yes, this is no longer needed. Removed
Collaborator
Author
|
Out of scope, but added tests for other controllers recently created |
btry
force-pushed
the
feature/use_controllers
branch
from
October 13, 2026 08:33
40308da to
d4bf980
Compare
btry
force-pushed
the
feature/use_controllers
branch
2 times, most recently
from
October 13, 2026 08:35
d4bf980 to
82b9804
Compare
btry
force-pushed
the
feature/use_controllers
branch
2 times, most recently
from
October 13, 2026 12:54
caab88b to
87a2bb8
Compare
btry
force-pushed
the
feature/use_controllers
branch
from
October 13, 2026 12:56
87a2bb8 to
9988363
Compare
btry
force-pushed
the
feature/use_controllers
branch
from
October 13, 2026 13:14
6a0c09e to
9d359a7
Compare
Rom1-B
reviewed
Oct 14, 2026
Rom1-B
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.