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

NO_DATA when editing a User Role #1163

Closed
lcharette opened this issue Jul 8, 2021 · 2 comments · Fixed by #1165
Closed

NO_DATA when editing a User Role #1163

lcharette opened this issue Jul 8, 2021 · 2 comments · Fixed by #1165
Assignees
Labels
confirmed bug Something isn't working
Milestone

Comments

@lcharette
Copy link
Member

lcharette commented Jul 8, 2021

When trying to add a role to an existing user, the request fails with NO_DATA alert :

Capture d’écran, le 2021-07-07 à 21 28 26

This exception is thrown :

throw new BadRequestException();

Chat discussion : https://chat.userfrosting.com/channel/support?msg=Znc57SpxqegM54yEc

Response :

{
    "message": "",
    "exception": [
        {
            "type": "UserFrosting\\Support\\Exception\\BadRequestException",
            "code": 0,
            "message": "",
            "file": "\/home\/vagrant\/userfrosting\/app\/sprinkles\/admin\/src\/Controller\/UserController.php",
            "line": 1330
        }
    ]
}

Request URI :

PUT /api/users/u/foo/roles

Route :

$this->put('/u/{user_name}/{field}', 'UserFrosting\Sprinkle\Admin\Controller\UserController:updateField');

Request data :

Type MIME: application/x-www-form-urlencoded; charset=UTF-8
csrf_name: csrf60e652263aa0e
csrf_value: 271c4e77ad3a2ad72a4877b366d7abef
value[0][role_id]: 1
value[1][role_id]: 2

roles from the URI doesn't seams to be passed to the Controller as field.

@lcharette lcharette added the confirmed bug Something isn't working label Jul 8, 2021
@lcharette lcharette added this to the 4.5.1 milestone Jul 8, 2021
@lcharette lcharette self-assigned this Jul 8, 2021
@lcharette
Copy link
Member Author

Template Ref : https://github.com/userfrosting/UserFrosting/blob/c92bf0b14f43cd53771d782f03c7b61c996ce814/app/sprinkles/admin/templates/modals/user-manage-roles.html.twig

Nothing changed in the last 2 years on those files... Not sure why it fails now... (unless it's been buggy all along).

@lcharette
Copy link
Member Author

lcharette commented Jul 9, 2021

Traced back the issue to these changes :

Template will need to be updated to follow deprecated changes...

lcharette added a commit to lcharette/UserFrosting that referenced this issue Jul 9, 2021
@lcharette lcharette mentioned this issue Jul 12, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant