-
Notifications
You must be signed in to change notification settings - Fork 638
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
User photo controller actions incompatible with front-end forms #3932
Comments
@andris-sevcenko I’ve added calls to |
We use these actions in a front-end form. Now it doesn't work anymore because |
I imagine a front-end-friendly controller would return success or failure in json format. As these controller actions stand at the moment, they throw errors when trying to render a CP template. The image saves before that so it functions, but it's dirty. |
@Moskydesign I suppose for this line, you just created your own front-end cms/src/controllers/UsersController.php Line 1253 in 406ad76
|
Yes, we do an ajax call and display the returned html after success. If it would only return success or failure we would have to build the render function our selfs, not that this wouldn't be possible but there happens to be an action specifically for uploading the photo, my understanding was that it was created for this use case. |
@Moskydesign have you customized your copy of the |
We have modified it a bit. Apart from the html we also had to change: It might not be very front-end friendly but it does provide a lot of flexibility on what you want to display. |
Alright, the (By the way, |
Description
Regarding these controller actions:
users/upload-user-photo
users/delete-user-photo
You can hit them from front-end (non-CP) forms, but they both fail trying to render CP templates.
See:
This isn't critical because it's possible to save and delete photos with the whole user via the
users/save-user
controller action.Additional info
The text was updated successfully, but these errors were encountered: