You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you attempt to create a relationship via API POST to /api/relations with a valid payload the caller is returned 500 Internal Server Error with payload:
{
"@context": "/api/contexts/Error",
"@type": "hydra:Error",
"hydra:title": "An error occurred",
"hydra:description": "Variable \"‘api\" is not valid around position 12 for expression `is_granted(‘api:post’)`.",
"trace": [
{
"namespace": "",
"short_class": "",
"class": "",
"type": "",
"function": "",
"file": "/Users/jamie/Desktop/Hotarucon/vendor/symfony/expression-language/Parser.php",
"line": 230,
"args": []
},
(rest of stack trace removed as it adds little value)
Details
Question
Answer
Relevant Bolt Version
5.1.0
Install type
Composer install
BC Break
n/a
PHP version
7.4
Web server
Apache
For UX/UI issues
n/a
Reproduction
Send a valid POST request to /api/relations using Postman or Bolt's built-in API tools. E.g.
The caller is returned 200 OK with a payload describing the new relationship.
Actual result
The caller is returned 500 Internal Server Error with a payload including a stack trace.
Potential cause
(My apologies I am a software tester by trade not a developer!)
In /src/Entity/Relation.php on line 18 the wrong quotation marks are used around api:post.
If you attempt to create a relationship via API POST to /api/relations with a valid payload the caller is returned 500 Internal Server Error with payload:
(rest of stack trace removed as it adds little value)
Details
Reproduction
Send a valid POST request to /api/relations using Postman or Bolt's built-in API tools. E.g.
Expected result
The caller is returned 200 OK with a payload describing the new relationship.
Actual result
The caller is returned 500 Internal Server Error with a payload including a stack trace.
Potential cause
(My apologies I am a software tester by trade not a developer!)
In /src/Entity/Relation.php on line 18 the wrong quotation marks are used around api:post.
Bug:
* "post"={"security"="is_granted(‘api:post’)"}
Correct:
* "post"={"security"="is_granted('api:post')"}
The text was updated successfully, but these errors were encountered: