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
Allows profile to override the avatar of employee #20430
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly improvement comments ^^
Seems like a great feature otherwise!
src/Core/Form/IdentifiableObject/DataHandler/ProfileFormDataHandler.php
Outdated
Show resolved
Hide resolved
...restaShopBundle/Resources/views/Admin/Configure/AdvancedParameters/Profiles/create.html.twig
Outdated
Show resolved
Hide resolved
src/PrestaShopBundle/Resources/views/Admin/Configure/AdvancedParameters/Profiles/edit.html.twig
Show resolved
Hide resolved
a20340e
to
64659e5
Compare
64659e5
to
d734898
Compare
src/Adapter/Profile/QueryHandler/GetProfileForEditingHandler.php
Outdated
Show resolved
Hide resolved
src/Core/Form/IdentifiableObject/DataHandler/ProfileFormDataHandler.php
Outdated
Show resolved
Hide resolved
Hi @Progi1984 All the steps from 1 to 21 are OK but after the step 21 it seems that the hook not override correctly and i still have the "default' avatars or the translator avatar created in the previous steps. The QA module is installed and configured with the script given in the step 25 and I still have the translator avatar: |
06f36d6
LGTM The employee avatar is correctly overrided by the Thanks @Progi1984 !! |
QA OK without required approvals !? |
Thanks @SD1982 |
1. Install PrestaShop
2. Add an avatar to group Translator
3. Add an employee "A" with an avatar
4. Add an employee "B" with an avatar and add it to Translator
5. Add an employee "C" without an avatar and add it to Translator
6. Add an employee "D" without an avatar
7. Add an employee "E" without an avatar with Gravatar
8. Add an employee "F" without an avatar with Gravatar and add it to Translator
9. Add an employee "G" with an avatar with Gravatar and add it to Translator
10. Connect as A
11. ✔️ The avatar of the employee A is displayed
12. Connect as B
13. ✔️ The avatar of the group Translator is displayed
14. Connect as C
15. ✔️ The avatar of the group Translator is displayed
16. Connect as D
17. ✔️ The avatar "White man on black background" is displayed
18. Connect as E
19. ✔️ The gravatar is displayed
20. Connect as F
21. ✔️ The avatar of the group Translator is displayed
22. Connect as superadmin
23. Install module
ps_qualityassurance
23 bis. Give permissions "View" on module
ps_qualityassurance
for the group "Translator"24. Register a new hook with
actionOverrideEmployeeImage
25. Use this code
$params['imageUrl'] = 'https://avatars.dicebear.com/api/male/' .urlencode($params['employee']->email).'.svg';
26. Connect as A, B, C, D, E, F, G
27. And the hook will override the avatar or gravatar :
📓 BC Break
PrestaShop\PrestaShop\Core\Form\IdentifiableObject\DataHandler\ProfileFormDataHandler
has a new second parameter : a parameter of typePrestaShop\PrestaShop\Core\Image\Uploader\ImageUploaderInterface
This change is