Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Getting Following errors while running the comment update Rest service.
{
"message": "A fatal error occurred: The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\rest\ResourceResponse."
}
Using below json format to test the service:
{
"_links": {
"type": {
"href": "http://localhost/d8_blog/drupal/rest/type/comment/comment"
}
},
"langcode":[{"value":"en"}],
"subject":[{"value":"New comment created on 01 March2"}],
"uid":[{"target_id":"1"}],
"status":[{"value":"1"}],
"comment_type":[{"target_id":"comment"}],
"default_langcode":[{"value":"1"}],
"comment_body":[{"value":"<p>New body...</p>","format":"basic_html"}]
}
Comments
Comment #2
rashid_786 CreditAttribution: rashid_786 at SDG Corporation commentedComment #3
rashid_786 CreditAttribution: rashid_786 at SDG Corporation commentedComment #4
swentel CreditAttribution: swentel commentedComment #5
Wim LeersComment #6
catchDuplicate of #2626298: REST module must cache only responses to GET requests.
Comment #7
sblommers CreditAttribution: sblommers commentedI have this also with a get request when using:
in my ServiceDefinition (services module). Seems like toUrl() somewhere is calling a render out of the context ?