Skip to content

Fix empty details view after renaming a file - #7783

Merged
juliusknorr merged 3 commits into
masterfrom
fix-empty-details-view-after-renaming-a-file
Jan 11, 2018
Merged

Fix empty details view after renaming a file#7783
juliusknorr merged 3 commits into
masterfrom
fix-empty-details-view-after-renaming-a-file

Conversation

@danxuliu

Copy link
Copy Markdown
Member

FileList._updateDetailsViewexpects either a file name (as a string) or a file model (as an OCA.File.FileInfoModel), but when called through updateInListan OC.Files.FileInfo object was given instead. As the given attribute was not a model _updateDetailsView treated it as a file name and tried to get the model for that file, which failed and caused the details view to be emptied.

All the tests in the "Renaming files" section added the test files,
although those calling "doRename()" added them by setting a path for the
file too. However, the path is ignored in the other tests, so adding the
files can be unified and moved to "beforeEach()".
This would be needed, for example, to show the details view for a file
before calling "doRename()".
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
"FileList._updateDetailsView" expects either a file name (as a string)
or a file model (as an "OCA.File.FileInfoModel"), but when called
through "updateInList" an "OC.Files.FileInfo" object was given instead.
As the given attribute was not a model "_updateDetailsView" treated it
as a file name and tried to get the model for that file, which failed
and caused the details view to be emptied.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@codecov

codecovBot commented Jan 11, 2018

Copy link
Copy Markdown

Codecov Report

Merging #7783 into master will not change coverage.
The diff coverage is n/a.

@@ Coverage Diff @@## master #7783 +/- ##
=========================================
Coverage 51.22% 51.22% Complexity 24967 24967 =========================================
Files 1607 1607 Lines 95002 95002 Branches 1376 1376 =========================================
Hits 48668 48668 Misses 46334 46334
Impacted FilesCoverage ΔComplexity Δ
apps/files_trashbin/lib/Expiration.php90.32% <0%> (-1.62%)29% <0%> (ø)
apps/files_trashbin/lib/Trashbin.php72.53% <0%> (+0.24%)136% <0%> (ø)⬇️

@MorrisJobkeMorrisJobke mentioned this pull request Jan 11, 2018
18 tasks
@juliusknorr
juliusknorr merged commit 7de3cce into masterJan 11, 2018
@juliusknorr
juliusknorr deleted the fix-empty-details-view-after-renaming-a-file branch January 11, 2018 11:27
@danxuliu

Copy link
Copy Markdown
MemberAuthor

Backported in #7792

Sign up for freeto 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.

3 participants

@danxuliu@rullzer@juliusknorr