Skip to content

PUT operation on media item to update caption doesn't work #2017

Closed
@tuxpiper

Description

@tuxpiper

Expected behaviour

The following operation:

PUT /api/v3/media/1
Content-type: application/json
Authorization: Bearer xxxxxxxxx

with body

{ "caption": "new caption" }

Should update the caption for the media item

Actual behaviour

The following response is returned by the server instead

500 Internal Server Error
{
  "errors": [
    {
      "status": 0,
      "title": "Validator media.update is not defined",
      "message": "Validator media.update is not defined",
      "class": "Exception",
      "file": "/var/www/html/platform/src/Factory/ValidatorFactory.php",
      "line": 44,
      "trace": [
        {
          "file": "/var/www/html/platform/src/Factory/UsecaseFactory.php",
          "line": 113,
          "function": "get",
          "class": "Ushahidi\\Factory\\ValidatorFactory",
          "type": "->",
          "args": [
            "media",
            "update"
          ]
        },
        {
          "file": "/var/www/html/platform/application/classes/Ushahidi/Rest.php",
          "line": 186,
          "function": "get",
          "class": "Ushahidi\\Factory\\UsecaseFactory",
          "type": "->",
          "args": [
            "media",
            "update"
          ]
        },
        {
          "file": "/var/www/html/platform/vendor/kohana/core/classes/Kohana/Controller.php",
          "line": 84,
          "function": "action_put_index",
          "class": "Ushahidi_Rest",
          "type": "->",
          "args": []
        },
        {
          "function": "execute",
          "class": "Kohana_Controller",
          "type": "->",
          "args": []
        },
        {
          "file": "/var/www/html/platform/vendor/kohana/core/classes/Kohana/Request/Client/Internal.php",
          "line": 97,
          "function": "invoke",
          "class": "ReflectionMethod",
          "type": "->",
          "args": [
            {
              "request": {},
              "response": {}
            }
          ]
        },
        {
          "file": "/var/www/html/platform/vendor/kohana/core/classes/Kohana/Request/Client.php",
          "line": 114,
          "function": "execute_request",
          "class": "Kohana_Request_Client_Internal",
          "type": "->",
          "args": [
            {},
            {}
          ]
        },
        {
          "file": "/var/www/html/platform/vendor/kohana/core/classes/Kohana/Request.php",
          "line": 997,
          "function": "execute",
          "class": "Kohana_Request_Client",
          "type": "->",
          "args": [
            {}
          ]
        },
        {
          "file": "/var/www/html/platform/httpdocs/index.php",
          "line": 38,
          "function": "execute",
          "class": "Kohana_Request",
          "type": "->",
          "args": []
        }
      ]
    }
  ]
}

Steps to reproduce the behaviour/error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions