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 preview generation in files api controller and adding unit tests #31184

Merged
merged 1 commit into from
Apr 19, 2018

Conversation

DeepDiver1975
Copy link
Member

front port of #31183

@DeepDiver1975 DeepDiver1975 added this to the development milestone Apr 18, 2018
@DeepDiver1975 DeepDiver1975 self-assigned this Apr 18, 2018
@DeepDiver1975 DeepDiver1975 requested a review from PVince81 April 18, 2018 09:57
@codecov
Copy link

codecov bot commented Apr 18, 2018

Codecov Report

Merging #31184 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #31184      +/-   ##
============================================
+ Coverage     62.55%   62.56%   +<.01%     
  Complexity    18279    18279              
============================================
  Files          1147     1147              
  Lines         68474    68474              
  Branches       1234     1234              
============================================
+ Hits          42833    42839       +6     
+ Misses        25280    25274       -6     
  Partials        361      361
Flag Coverage Δ Complexity Δ
#javascript 52.05% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 63.75% <100%> (ø) 18279 <0> (ø) ⬇️
Impacted Files Coverage Δ Complexity Δ
lib/private/PreviewManager.php 54.41% <100%> (+4.41%) 50 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e8f38c...fb621f1. Read the comment docs.

@@ -139,7 +139,7 @@ public function createPreview($file, $maxX = 100, $maxY = 75, $scaleUp = false)
if ($user === null) {
throw new NotLoggedInException();
}
$file = $this->rootFolder->getUserFolder($user->getUID())->get($file);
$file = $this->rootFolder->getUserFolder($user->getUID())->getParent()->get($file);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as the change is different than the one on stable10, is there an explanation for why this is the right approach ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the api change on master requires a node to be passed into the preview class.
to get the node object for the given path the lazyroot is used as well as getUserFolder.

because the give file path already contains the folder 'files' the get parent call is necessary.

due to missing tests this all way hidden and never popped up - test got added and now if works.

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code makes sense, not tested 👍

@phil-davis
Copy link
Contributor

Reproduced the thumbnail problem on current master.
Switched to this branch - thumbnails working.
👍

@phil-davis phil-davis closed this Apr 18, 2018
@phil-davis phil-davis reopened this Apr 18, 2018
@phil-davis
Copy link
Contributor

Arghhh! I pressed "close and comment" instead of just "comment". Now when I reopen it seems to be running CI again.

@phil-davis phil-davis merged commit 5985706 into master Apr 19, 2018
@phil-davis phil-davis deleted the bugfix/master/files-api-controller-refs-29914 branch April 19, 2018 01:49
@PVince81 PVince81 modified the milestones: development, QA Jun 13, 2018
@lock
Copy link

lock bot commented Jul 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants