-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Avatar image deletion don't update avatar field in yaml file. #2805
Comments
Avatar cannot be deleted because of deleting it will not trigger AJAX request to delete the file. Additionally |
Actually on deletion from admin the AJAX call is send and the file is well deleted, this is just the blueprint that isn't updated. My guess would be to toggle $keepEmptyValues from filter function of Grav\Common\Data. Editing method taskSaveUser() in admincontroller, line 704 as follow :
to
It seem to fix the issue, I don't know if there is other repercussion. |
Looks like I've already fixed this in 6a9724d#diff-a387dc90668050191ec659f1e145f5e0R34 |
@rhukster Do we need to backport this one or is it ok to have it fixed only in Grav 1.7? |
Cherry picked the fix to Grav 1.6 as well. |
This fix does work, thank you ! |
Environment :
Also tested on window Wamp
Step to reproduce the bug :
What should happen :
There should be no image on the filepicker zone
What happen :
There is a blank image with the same information as the previously upload image
What the issue :
When we delete a profile image, Admin plugin call taskRemoveFileFromBlueprint() method in adminbasecontroller.php that correctly delete the image from the user/accounts/avatar folder but don't update the avatar field in the yaml file.
I would like to provide a fix but I don't know if the yaml file should be updated in taskRemoveFileFromBlueprint() or should be done trough taskSaveUser()
I suspect it should be done in the taskSaveUser() but the data filter seem to remove the avatar field when it is empty (see Grav/Common/Data/Validation.php)
The text was updated successfully, but these errors were encountered: