[main] Twig Error in template "templates/pages/setup/webhook/webhook.html.twig"
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- [X] I have searched the existing issues
Version
main
Bug description
Twig Error (Twig\Error\RuntimeError): "An exception has been thrown during the rendering of a template ("Class name must be a valid object or a string")." in template "glpi-core/main/htdocs/templates/pages/setup/webhook/webhook.html.twig" at line 45
This seems to be happening since this commit d75c417cd8fafb04c7e6ca902f2339f4580c2f65
Webhook::getAPIItemtypeData no longer returns the same array.
Example before the mentionned commit:
After the mentionned commit:
Notice the "10 > Glpi\CustomeAsset\Voiture", which must certainly be the cause of the error generated (10 not being an itemtype)
Relevant log output
No response
Page URL
front/webhook.form.php
Steps To reproduce
To reproduce the bug, you need to have a generic object (created from front/asset/assetdefinition.php). Once you have a generic object, just go to the webhook creation page.
Your GLPI setup information
No response
Anything else?
No response
Preview tab of a existing webhook is broken also with the same error
Is this still an issue? Custom assets aren't valid itemtypes for webhooks anymore since they aren't supported by the new API yet. They were only available in error when using itemtypes directly from the asset_types array instead of a more controlled list.
I am not able to reproduce. Generic assets are not anymore listed in webhooks and therefore this issue is not relevant anymore.