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

[16.0][FIX] fs_attachment: respect controller parameters for /web/content/ #365

Merged
merged 1 commit into from May 10, 2024

Conversation

hbrunn
Copy link
Member

@hbrunn hbrunn commented Apr 27, 2024

when we craft a link like

/web/content?model=my.model&filename_field=filename&field=binary_field&mimetype=mime.type&filename=myfile.name

the parameters are ignored and the resulting download gets the generic (wrong) name/mimetype from the attachment of the binary field if it is of type fs. For filestore attachments, this happens in ir.binary#_get_stream_from, so I think we need to do the same thing for fs attachments. Otherwise, we can't really use this as drop-in replacement for storing binary fields in object storage.

@OCA-git-bot
Copy link
Contributor

Hi @lmignon,
some modules you are maintaining are being modified, check this out!

@lmignon
Copy link
Sponsor Contributor

lmignon commented Apr 29, 2024

Thank you for the fix @hbrunn Can you I a unittest to check that it works in the initial case and with fs_attachment?

@hbrunn hbrunn force-pushed the 16.0-fs_attachment-_get_stream_from branch from 902ae9a to d0c9fa8 Compare May 1, 2024 08:03
@hbrunn
Copy link
Member Author

hbrunn commented May 6, 2024

/ocabot rebase

@OCA-git-bot
Copy link
Contributor

Congratulations, PR rebased to 16.0.

@OCA-git-bot OCA-git-bot force-pushed the 16.0-fs_attachment-_get_stream_from branch from d0c9fa8 to 8d52fb0 Compare May 6, 2024 06:55
@lmignon
Copy link
Sponsor Contributor

lmignon commented May 10, 2024

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-365-by-lmignon-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 9f137eb into OCA:16.0 May 10, 2024
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at f4a2829. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants