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

Web client doesn't update media caption #2018

Closed
tuxpiper opened this issue Aug 17, 2017 · 7 comments
Closed

Web client doesn't update media caption #2018

tuxpiper opened this issue Aug 17, 2017 · 7 comments

Comments

@tuxpiper
Copy link
Member

tuxpiper commented Aug 17, 2017

Expected behaviour

When editing a post, and editing a the caption of an attached image, the caption should be modified after clicking submit.

Actual behaviour

The caption is for the image is not changed.


---- API Issue description -----

#2017

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": []
        }
      ]
    }
  ]
}

Aha! Link: https://ushahiditeam.aha.io/features/PROD-535

@tuxpiper tuxpiper added the Bug label Aug 17, 2017
@rjmackay
Copy link
Contributor

rjmackay commented Sep 4, 2017

@rowasc yes this would make sense to fix. For now, it only needs to allow updating the caption, not the image itself

@rowasc
Copy link
Contributor

rowasc commented Sep 4, 2017

Details/Clarification for the implementation: What happens here, is that you can update the image+caption, but you can't update the caption unless you update the image. If you only change the caption, the client doesn't attempt the PUT operation

@rjmackay
Copy link
Contributor

rjmackay commented Sep 4, 2017

Ah! Ok that makes sense. You'd need to confirm that the PUT on the API works properly too

@rowasc
Copy link
Contributor

rowasc commented Sep 4, 2017

Yup. There's something about that in #2017
When I work on 2018 I'll check that other one, too. 👍

@jshorland
Copy link

I can't even get a caption to save or appear at all within qa.ushahididev.com. P0.

@rowasc
Copy link
Contributor

rowasc commented Feb 28, 2018

@jshorland does this go into cycle 1?

@tuxpiper
Copy link
Member Author

Bump and adding client request tag. This issue has been flagged by a responder client. @caharding could we consider adding it to the next cycle?

Related issue #2017 describes the underlying problem in the API

@rowasc rowasc removed this from the Milestone placeholder milestone Sep 7, 2018
@Angamanga Angamanga added the Community Task Issues that the Ushahidi OSS community is encouraged to contribute to label Mar 14, 2019
@rowasc rowasc added the Size: S label Jun 24, 2019
@rowasc rowasc added this to the Parking Lot milestone Sep 4, 2020
@tuxpiper tuxpiper removed the Size: S label Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants