• Members 19 posts
    March 28, 2017, 5:43 p.m.
    PATCH http://sagebeta.ddns.net:8181/api/threads/10/ 400 ()
    send @ vendor.js [sm]:13138
    ajax @ vendor.js [sm]:12619
    (anonymous) @ misago.js [sm]:37547
    value @ misago.js [sm]:37506
    value @ misago.js [sm]:37662
    value @ misago.js [sm]:21575
    r.handleSubmit @ misago.js [sm]:4664
    r @ vendor.js [sm]:22912
    a @ vendor.js [sm]:16996
    s @ vendor.js [sm]:17019
    p @ vendor.js [sm]:16421
    m @ vendor.js [sm]:16432
    r @ vendor.js [sm]:28322
    processEventQueue @ vendor.js [sm]:16635
    r @ vendor.js [sm]:22980
    handleTopLevel @ vendor.js [sm]:22991
    i @ vendor.js [sm]:23068
    perform @ vendor.js [sm]:27623
    batchedUpdates @ vendor.js [sm]:22744
    i @ vendor.js [sm]:25751
    dispatchEvent @ vendor.js [sm]:23143
    misago.js [sm]:21590 Object {detail: "PATCH request should be list of operations", status: 400, statusText: "error"}

    When I click save changes this error pops up on the output.

  • arrow_forward

    Thread has been moved from Development Discussion.

  • edit

    Thread title has been changed from Cannot edit the title of thread.

  • edit

    Thread title has been changed from Cannot edit the title of thread edit.

  • March 28, 2017, 9:44 p.m.

    Please don't use "dev discussion" category for possible bug reports.

    As for bug, I can't reproduce it. I'm able to edit this thread's title just fine while running on latest release.

    I've went to your site and looked up the source of the function and it looks ok:

    return _ajax2.default.patch(this.props.thread.api.index, [{ op: 'replace', path: 'title', value: this.state.title }]);

    This function sends PATCH with title change as list of operations, just like it does here. What browser are you using?

  • Members 19 posts
    March 29, 2017, 1:25 a.m.

    Im very sorry for posting it in the dev category. I was in a rush and just needed to let you know.
    Anyway, im using Chrome on Windows 10 x64.

  • March 29, 2017, 8:47 a.m.

    Ok, so whats known about the issue so far:

    • all the behaviors you've reported work on this forum
    • all the behaviors you've reported have passing tests

    I would now test if its ALL PATCH actions that fail or just some:

    • Can you pin thread using moderation options?
    • Can you close it using moderation options?
  • March 29, 2017, 9:48 a.m.

    Also, can you modify the check in your Misago's installation to see whats in its request.data?

  • Members 19 posts
    March 31, 2017, 12:58 a.m.
    def dispatch(self, request, target):
            if not isinstance(request.data, list):
                return Response({
                    'detail': "PATCH request should be list of operations",
                }, status=400)
            detail = []
            is_errored = False
            patch = {'id': target.pk}
            for action in request.data:
                    self.dispatch_action(patch, request, target, action)
                except Http404:
                    is_errored = True
                    detail.append('NOT FOUND')
                except (InvalidAction, PermissionDenied) as e:
                    is_errored = True
            patch['detail'] = detail
            if is_errored:
                return Response(patch, status=400)
                return Response(patch)

    That's the code I have in that file. This is only an issue on google chrome. All other browsers are perfectly fine.