Make sure to get file model in template picker#30440
Merged
juliusknorr merged 1 commit intomasterfrom Dec 30, 2021
Merged
Conversation
artonge
reviewed
Dec 29, 2021
juliusknorr
approved these changes
Dec 29, 2021
Member
juliusknorr
left a comment
There was a problem hiding this comment.
Could not trigger it myself but change seems good 👍
1cecb10 to
6bf38db
Compare
Member
|
Lint failures |
artonge
requested changes
Dec 30, 2021
6bf38db to
c69da07
Compare
artonge
approved these changes
Dec 30, 2021
Member
Author
|
This can be backported in 21, 22 and 23 IMO. |
Contributor
|
/compile amend / |
Contributor
|
/backport to 23 |
Contributor
|
/backport to 22 |
Contributor
|
/backport to 21 |
Signed-off-by: Julien Veyssier <eneiluj@posteo.net> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
c69da07 to
4d32f11
Compare
Contributor
|
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. |
Member
|
/backport to stable23 |
Member
|
/backport to stable22 |
Member
|
/backport to stable21 |
|
The backport to 23 failed. Please do this backport manually. |
This was referenced Dec 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
awaitto.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.