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

File and folder location is wrong at shared external folders #15858

Closed
nickvergessen opened this issue Apr 24, 2015 · 13 comments · Fixed by #19615
Closed

File and folder location is wrong at shared external folders #15858

nickvergessen opened this issue Apr 24, 2015 · 13 comments · Fixed by #19615

Comments

@nickvergessen
Copy link
Contributor

Originally reported at owncloud/activity#284 by @tibmanus

Steps to reproduce

  1. Admin user mounts a local folder as an external storage. (Folder name: Localhhh)
  2. Admin user creates a folder inside this folder (Folder name: external), then shares it with 'testuser'.
  3. Testuser creates a file in this folder (Name: file1).
  4. Testuser checks the Activity app: "You created file1"

Expected behaviour

Tooltip and link shows the correct location for testuser: external/

Actual behaviour

Tooltip and link for testuser goes to this location: externalcalhhh/external

Server configuration

Operating system:
Ubuntu 14.04

Web server:
Apache2

Database:
SQLite

ownCloud version: (see ownCloud admin page)
8.02

Updated from an older ownCloud or fresh install:
Happens both at fresh and updated version.

Are you using external storage, if yes which one:
local

Are you using encryption:
no

Are you using an external user-backend, if yes which one:
no

lib/private/share/share.php#L282-L288

                    while ($row = $result->fetchRow()) {
                        foreach ($fileTargets[$row['fileid']] as $uid => $shareData) {
                            $sharedPath = $shareData['file_target'];
                            $sharedPath .= substr($path, strlen($row['path']) -5);
                            $sharePaths[$uid] = $sharedPath;
                        }
                    }

This code generates broken paths. Instead of $path starting with files/ it starts with the mount point name, so stripping should be until the next slash instead of hardcoded 5 characters?

@nickvergessen nickvergessen added this to the 8.0.4-next-maintenance milestone Apr 24, 2015
@nickvergessen
Copy link
Contributor Author

// cc @schiesbn @rullzer

@ghost ghost modified the milestones: 8.0.5-next-maintenance, 8.0.4-current-maintenance May 27, 2015
@PVince81
Copy link
Contributor

Is this OC 8.0 only ? Anything that can be backported from 8.1 ?

@nickvergessen nickvergessen modified the milestones: 8.1-current, 8.0.5-current-maintenance Jun 18, 2015
@nickvergessen
Copy link
Contributor Author

No, I somehow was in the wrong milestone-setting-mind from other projects.

Affects both 8.1 and 8.0

@SergioBertolinSG
Copy link
Contributor

Tested in last 8.1 version (2015-06-19). I can reproduce it.

@SergioBertolinSG SergioBertolinSG modified the milestones: 8.2-next, 8.1-current Jun 19, 2015
@schiessle
Copy link
Contributor

This code generates broken paths. Instead of $path starting with files/ it starts with the mount point name, so stripping should be until the next slash instead of hardcoded 5 characters?

Not sure if we want to strip away the mount point (btw. a mount point doesn't need to be in the root folder). I think what we want is the complete path relative to the files folder, right?

@nickvergessen
Copy link
Contributor Author

What I want is the full path of the sharee, not the sharer. So yes we need to strip away the mount point name

@PVince81
Copy link
Contributor

@schiesbn @nickvergessen @rullzer possibly still an issue in 8.2 beta ?

@nickvergessen
Copy link
Contributor Author

Yes, still a verify annoying issue

changed the line numbers to match the new code position:

while ($row = $result->fetchRow()) {
foreach ($fileTargets[$row['fileid']] as $uid => $shareData) {
$sharedPath = $shareData['file_target'];
$sharedPath .= substr($path, strlen($row['path']) -5);
$sharePaths[$uid] = $sharedPath;
}
}

@ghost
Copy link

ghost commented Oct 1, 2015

This bug will fall off 8.2 if not resolved by 6 Oct

@schiessle
Copy link
Contributor

What I want is the full path of the sharee, not the sharer. So yes we need to strip away the mount point name

I'm still not sure what's the right behavior here. If you want the full path we don't have to trip away the mount point but first get the complete path relative to /files and then strip away files/. Stripping away the mount point doesn't give you the full path but the relative path to the mount point.

@nickvergessen
Copy link
Contributor Author

@icewind1991

@icewind1991
Copy link
Contributor

Atm there is no need to do this without taking a horrible performance panalty, there are plans to add a table which would allow this (mount point for users table)

@ghost ghost modified the milestones: 9.1-current, backlog Mar 31, 2016
@ghost ghost assigned nickvergessen Mar 31, 2016
@lock
Copy link

lock bot commented Aug 5, 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 5, 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.

5 participants