-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Make sure to get file model in template picker #30440
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.
Could not trigger it myself but change seems good 👍
1cecb10
to
6bf38db
Compare
Lint failures |
6bf38db
to
c69da07
Compare
This can be backported in 21, 22 and 23 IMO. |
/compile amend / |
/backport to 23 |
/backport to 22 |
/backport to 21 |
Signed-off-by: Julien Veyssier <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
c69da07
to
4d32f11
Compare
CI failure is unrelated. Merge when you want @eneiluj :) |
The backport to 21 failed. Please do this backport manually. |
The backport to 22 failed. Please do this backport manually. |
/backport to stable23 |
/backport to stable22 |
/backport to stable21 |
The backport to 23 failed. Please do this backport manually. |
If the template picker creates a file which is not immediately rendered in the file list, it fails to get the FileInfoModel (which is then passed to the default file action). This does not break the Text app because its file action does not use the FileInfoModel. It does break the OnlyOffice app (and maybe others) file creation from a template.
The template picker fails to get the model because
FileList::getModelForFile()
relies on the DOM and the freshly created file is sometimes not added/rendered.The created file item is not rendered if the target position is out of what's currently visible/loaded.
Fortunately,
FileList::addAndFetchFileInfo()
fetches the file metadata and we can use it to generate the file model in the template picker.I switched from
await
to.then()
because I couldn't find another way to get the promise result when multiple parameters are passed toresolve()
.We have to be careful when backporting this. So far, I saw that a few changes are necessary to make it work in stable22.