Skip to content

if it is a mount point we need to get the path from the mount manager - #17225

Merged
schiessle merged 1 commit into
masterfrom
fix_12106
Jun 30, 2015
Merged

schiessle merged 1 commit into
masterfrom
fix_12106

Conversation

@schiessle

Copy link
Copy Markdown
Contributor

steps to test:

  • create three user: user1, user2, user3
  • add user2 and user3 to the group 'users'
  • user1 mounts a external storage to "MountPoint"
  • user1 uploads a file to the external storage
  • user1 shares the mount point with the group 'users'
  • user1 navigate to the external storage and opens the share drop-down of the uploaded file

Without this patch you will see:
"Shared in {item} with users"

With this patch:
"Shared in MountPoint with users"

fix #12106

@schiessle schiessle added this to the 8.1-current milestone Jun 29, 2015
@schiessle

Copy link
Copy Markdown
Contributor Author

@rullzer maybe you have some time to review it? Thanks!

@ghost

ghost commented Jun 29, 2015

Copy link
Copy Markdown

🚀 Test PASSed.🚀
chuck

@nickvergessen

Copy link
Copy Markdown
Contributor

👍

@nickvergessen

Copy link
Copy Markdown
Contributor

Easy to review and test, @MorrisJobke

@MorrisJobke

Copy link
Copy Markdown
Contributor

Handover to @LukasReschke :P

@LukasReschke

Copy link
Copy Markdown
Contributor

Handsback to @MorrisJobke.

@LukasReschke LukasReschke self-assigned this Jun 29, 2015
Comment thread lib/private/share/share.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might be safer to use trim($path, '/'). Never assume that getMountPoint will give you something with a leading slash...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I want to remove the trailing slash, if it exists.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, my point was that you should also remove the leading slash if it exists.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah, ok... yes, makes probably sense. I will update the PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done @PVince81 please have another look, thanks!

Comment thread .idea/codeStyleSettings.xml Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will push revert once Jenkins finished. Don't know why my IDE always manipulate this value since today...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Welcome in the club ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

did it happen to you too? Any idea how to solve it? The strange thing is that it only happens since today but I didn't updated anything on my system and the branch already existed yesterday. Unless PHPStorm did some updates this morning in the background and didn't notified me I don't know what changed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yup. Please complain at #14287 and write that we want this 🙊

@ghost

ghost commented Jun 30, 2015

Copy link
Copy Markdown

🚀 Test PASSed.🚀
chuck

Comment thread lib/private/share/share.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

-1 string ? Is there a risk that sometimes it will be an int ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the parent column of filecache is an int - I'd expect this to be compared against -1 instead of '-1'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

to my knowledge PHP convert all query results to string. If you grep the code you will find places where we explicitly cast it back to int. But the result of a db query always returns all values as string.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this covered by a unit test ? It would make sure that all tested DBs would return the proper value.

By the way, this PR seems to have no unit test change ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

By the way, this PR seems to have no unit test change ?

We don't really have a way to test this explicitly because of all the static classes and methods.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can't wait for the full rewrite.

Fine by me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As said, that's the way it is done all over the code, most likely also on places where we have unit tests. If you search the internet you will also find various discussions where people always explain that this is how PHP works. But I changed the code for now to cast it to a int and then compare the int values, just to give us all a better feeling 😄

@PVince81

Copy link
Copy Markdown
Contributor

Tested with personal mount, works.

Tested with system mount assigned to only user1, the share dropdown will show "Shared in externalmount with users, user2, user3". Might be a separate issue ?

@schiessle

Copy link
Copy Markdown
Contributor Author

Tested with system mount assigned to only user1, the share dropdown will show "Shared in externalmount with users, user2, user3". Might be a separate issue ?

I can't reproduce it. Works also with system mount here.

@schiessle

Copy link
Copy Markdown
Contributor Author

My steps:

  • create three user: user1 (admin), user2, user3
  • add user2 and user3 to the group 'users'
  • user1 mounts a external storage to "MountPoint" in the admin settings only for user1
  • user1 uploads a file to the external storage
  • user1 shares the mount point with the group 'users'
  • user1 navigate to the external storage and opens the share drop-down of the uploaded file

Result: "Shared in MountPoint with users"

Also tried:

  • create user admin on installation
  • create three user: user1, user2, user3
  • add user2 and user3 to the group 'users'
  • admin mounts a external storage to "MountPoint" in the admin settings only for user1
  • user1 uploads a file to the external storage
  • user1 shares the mount point with the group 'users'
  • user1 navigate to the external storage and opens the share drop-down of the uploaded file

Result: "Shared in MountPoint with users"

@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@schiessle

Copy link
Copy Markdown
Contributor Author

@owncloud-bot retest this please

@PVince81

Copy link
Copy Markdown
Contributor

These were my steps, yes. Strange.
Let me try again from scratch.

@PVince81

Copy link
Copy Markdown
Contributor

I retried the steps and it works now.
I wonder if it's because I initially had the global mount applied to all and only later set it to "user1".

Anyway, fine now 👍

@ghost

ghost commented Jun 30, 2015

Copy link
Copy Markdown

🚀 Test PASSed.🚀
chuck

1 similar comment
@ghost

ghost commented Jun 30, 2015

Copy link
Copy Markdown

🚀 Test PASSed.🚀
chuck

schiessle added a commit that referenced this pull request Jun 30, 2015
if it is a mount point we need to get the path from the mount manager
@schiessle
schiessle merged commit 2c1b0f9 into master Jun 30, 2015
@schiessle
schiessle deleted the fix_12106 branch June 30, 2015 14:40
@davitol

davitol commented Jul 2, 2015

Copy link
Copy Markdown
Contributor

👍 It works in 8.1 RC2

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 11, 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.

External Storage: Sub folder group sharing broken

8 participants