Skip to content
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

Rely on controller for inventory #18312

Merged
merged 16 commits into from
Nov 21, 2024

Conversation

trasher
Copy link
Contributor

@trasher trasher commented Nov 14, 2024

  • I did not found how to redirect the old front file the the new controller.
  • Command line capacities are not official, so I've just kept them in the tools directory.
  • I've just tested with computer inventory (I do not have a setup for inventory-plugin capacities)

Refused equipments conversion should maybe use their own route, I did not test this case yet (this may be done in another PR, will see).

@trasher
Copy link
Contributor Author

trasher commented Nov 14, 2024

ping @cedric-anne, I need a "pre-review" for this one.

@cedric-anne
Copy link
Member

I did not found how to redirect the old front file the the new controller.

You can add a #[Route("/front/inventory.php", name: "glpi_inventory_legacy")] attribute to your route. This will not redirect clients, but will instead execute the controller method directly.

Command line capacities are not official, so I've just kept them in the tools directory.

There is no reason for it to be used in production. I guess it is mostly used to easilly process inventory files when debugging an issue.

src/Glpi/Agent/Communication/AbstractRequest.php Outdated Show resolved Hide resolved
src/Glpi/Controller/InventoryController.php Outdated Show resolved Hide resolved
tools/inventory.php Outdated Show resolved Hide resolved
tools/inventory.php Outdated Show resolved Hide resolved
tools/inventory.php Outdated Show resolved Hide resolved
tools/inventory.php Outdated Show resolved Hide resolved
src/Glpi/Controller/InventoryController.php Outdated Show resolved Hide resolved
src/Glpi/Controller/InventoryController.php Outdated Show resolved Hide resolved
src/Glpi/Controller/InventoryController.php Outdated Show resolved Hide resolved
@trasher trasher force-pushed the feature/inventory-controller branch 3 times, most recently from bee3568 to 6436d7e Compare November 15, 2024 13:51
@trasher
Copy link
Contributor Author

trasher commented Nov 18, 2024

I do not understand why tests fails with unsupported method while GET and POST are both explicitly allowed on the route.

src/Session.php Outdated Show resolved Hide resolved
src/Glpi/Controller/InventoryController.php Outdated Show resolved Hide resolved
src/Glpi/Controller/InventoryController.php Outdated Show resolved Hide resolved
Add test on prolog request for all possibles calls (/, /Inventory and front/inventory.php)
@trasher trasher marked this pull request as ready for review November 20, 2024 13:54
Copy link
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

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

Seems OK.

src/Glpi/Controller/InventoryController.php Outdated Show resolved Hide resolved
@trasher trasher merged commit 789625a into glpi-project:main Nov 21, 2024
8 checks passed
@trasher trasher deleted the feature/inventory-controller branch November 21, 2024 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants