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

fix: Return a file element even if the rendered list does not contained one #45121

Open
wants to merge 1 commit into
base: stable27
Choose a base branch
from

Conversation

juliushaertl
Copy link
Member

@juliushaertl juliushaertl commented Apr 30, 2024

Proper fix replacing #45031

When creating a file from a template we trigger a file action. This has a dependency on the file element $el that is used by some apps in <27 to get certain file attributes. Now while we wait for the file to be added to the file list, it might not be rendered if it is added at the end of the list outside the visible view.

This PR addresses it by adding a fallback to return the rendered row in case we could not find the element in the DOM.

Onlyoffice is one example using this https://github.com/ONLYOFFICE/onlyoffice-nextcloud/blob/master/src/main.js#L212 but there are potentially others out there as well.

Steps to reproduce:

  • Setup onlyoffice
  • Have a directory that has lots of files
  • Create a new file Called "Z.docx" so it is put at the very end of the file list from a template

Error before the change

Screenshot 2024-04-30 at 14 32 47

@juliushaertl juliushaertl requested review from a team, Fenn-CS, sorbaugh and emoral435 and removed request for a team April 30, 2024 12:30
@juliushaertl juliushaertl added bug 3. to review Waiting for reviews labels Apr 30, 2024
@juliushaertl juliushaertl added this to the Nextcloud 27.1.10 milestone Apr 30, 2024
@juliushaertl juliushaertl requested review from max-nextcloud, a team, szaimen, sorbaugh and susnux and removed request for sorbaugh, emoral435 and a team May 14, 2024 09:05
@szaimen szaimen removed their request for review May 14, 2024 09:24
@skjnldsv skjnldsv mentioned this pull request May 15, 2024
15 tasks
@skjnldsv skjnldsv mentioned this pull request May 22, 2024
14 tasks
…ed one

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants