Skip to content

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

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
hbrunn:16.0-fs_attachment-_get_stream_from
May 10, 2024
Merged

[16.0][FIX] fs_attachment: respect controller parameters for /web/content/#365
OCA-git-bot merged 1 commit intoOCA:16.0from
hbrunn:16.0-fs_attachment-_get_stream_from

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
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
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
@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.

3 participants

Comments