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

Node API: search operations don't work on the top folder of external shares #19544

Closed
oparoz opened this issue Oct 2, 2015 · 3 comments · Fixed by #19546
Closed

Node API: search operations don't work on the top folder of external shares #19544

oparoz opened this issue Oct 2, 2015 · 3 comments · Fixed by #19546

Comments

@oparoz
Copy link
Contributor

oparoz commented Oct 2, 2015

Steps to reproduce

$folder = $this->rootFolder->get('/admin/files/mounted_external_owncloud')
$result = $folder->searchByMime('image')
var_dump($result);

Expected result

An array full of Files

Actual result

An empty result

Notes

Querying a sub-folder works...

$folder = $this->rootFolder->get('/admin/files/mounted_external_owncloud/subfolder')
$result = $folder->searchByMime('image')
var_dump($result);

@icewind1991 @PVince81

@oparoz
Copy link
Contributor Author

oparoz commented Oct 2, 2015

This doesn't work:

if ($internalRootLength === 0 or substr($result['path'], 0, $internalRootLength) === $internalPath) {

if ($internalRootLength === 0 or substr($result['path'], 0, $internalRootLength) === $internalPath) {

with

$internalPath = rtrim($internalPath, '/') . '/'; <------- Minimum size is 1
$internalRootLength = strlen($internalPath) = 1

which can never match 0

@oparoz
Copy link
Contributor Author

oparoz commented Oct 2, 2015

Broken since 8.0 by this PR: fcc3b3d
@PVince81

@oparoz oparoz changed the title Node API: searchByMime doesn't work properly on external shares Node API: search operations don't work on the top folder of external shares Oct 2, 2015
@DeepDiver1975 DeepDiver1975 added this to the 8.2-current milestone Oct 5, 2015
@lock
Copy link

lock bot commented Aug 7, 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 Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants