Wednesday, October 12, 2022
1 change · master
Resolved issues and error corrections
Internal users can now add Unsplash images through the media dialog without running into access errors. The fix also makes forum image handling more reliable when editing posts, ensuring the correct post is linked.
Original PR description
Copy of https://github.com/odoo/odoo/pull/102626, meant to be back-ported. *: web_unsplash, website_forum With [1], the access errors when a portal user were using the media dialog got fixed. It also…
Copy of https://github.com/odoo/odoo/pull/102626, meant to be back-ported. *: web_unsplash, website_forum With [1], the access errors when a portal user were using the media dialog got fixed. It also came with the unsplash capability for portal user in the media dialog. Still, there was a remaining problematic point: an internal user can't upload an unsplash image in the backend through the media dialog. It doesn't really make sense for an internal user to have less right than the portal user. This commit corrects that part. Note that only unsplash images were problematic, not regular uploaded image as the difference was that unsplash images attachment are saved with an `url` property, which was triggering due to [2]. Finally, it was chosen to make that "bypass" more robust and opt in, so forum and unsplash are allowing their use cases to go through, it's not done in a generic way anymore. Also fixing a small issue about the res_id not being sent when editing a forum post, because it was assuming that the URL would end with the ID which is not the case when you edit your answer. [1]: https://github.com/odoo/odoo/commit/e10493711879c7f0cc8832db3f1936c622ea605c [2]: https://github.com/odoo/odoo/commit/bfffe39f1376a56226572295b945a2cc73ba50ce task-3007844