Skip to content

Do not retrieve shares through group if user has no group - #13463

Merged
LukasReschke merged 1 commit into
masterfrom
share-getitemsharedwithuser-emptygroup
Jan 23, 2015
Merged

LukasReschke merged 1 commit into
masterfrom
share-getitemsharedwithuser-emptygroup

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

Follow up for #13423

On master, this saves on query.
It seems that the query just becomes shared_with in (NULL) when the user has no groups assigned.

On stable7 however it fails with an exception and breaks.
So this fix here will be required for the backport of #13423 (discovered during backport)

Please review @schiesbn @MorrisJobke @LukasReschke @DeepDiver1975

@PVince81

Copy link
Copy Markdown
Contributor Author

I bascially just added an if and unit tests, see white-space less diff: https://github.com/owncloud/core/pull/13463/files?w=1

@PVince81 PVince81 added this to the 8.0-current milestone Jan 19, 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.

if (!empty($groups)) { instead?

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 always forget that PHP has that... In JS I'd have written if (!groups)

@nickvergessen

Copy link
Copy Markdown
Contributor

Patch idea seems reasonable.

@PVince81
PVince81 force-pushed the share-getitemsharedwithuser-emptygroup branch from f31e68e to 2838fb6 Compare January 19, 2015 14:39
@ghost

ghost commented Jan 19, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/7311/
🚀 Test PASSed. 🚀

@PVince81

Copy link
Copy Markdown
Contributor Author

Yes it is!

Or were you referring to Jenkins passing even after a force push ?

@MorrisJobke

Copy link
Copy Markdown
Contributor

👍

@LukasReschke

Copy link
Copy Markdown
Contributor

Rebase required

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.

What happens if a user is more in than 1000 groups on SQLite? – The in statement should explode on SQLite.

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.

(though unrelated)

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.

@nickvergessen
nickvergessen force-pushed the share-getitemsharedwithuser-emptygroup branch from 2838fb6 to 8fa3e7a Compare January 23, 2015 14:11
@nickvergessen

Copy link
Copy Markdown
Contributor

rebased

@ghost

ghost commented Jan 23, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/7853/
🚀 Test PASSed. 🚀

@LukasReschke

Copy link
Copy Markdown
Contributor

👍

LukasReschke added a commit that referenced this pull request Jan 23, 2015
…mptygroup

Do not retrieve shares through group if user has no group
@LukasReschke
LukasReschke merged commit 080a41a into master Jan 23, 2015
@LukasReschke
LukasReschke deleted the share-getitemsharedwithuser-emptygroup branch January 23, 2015 14:58
@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 16 new issues, 4 updated code elements

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

5 participants