-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Implementation of 'show related' functionality #1432 #1993
Conversation
Syncing from original
Update to latest version on elabftw/hypernext
Modify SQL query to list only related items and experiments for which the user has read permission.
This reverts commit 4dc349f.
Change variable and function names.
Change function names.
Change variable names.
Simplify source code
This reverts commit 80c4039.
Hello, I don't like the code duplication that this creates. |
also, this is just for view mode right? So you don't need to get all of that from the db, just what you'll display, category, name and id is enough. |
Remove code duplication.
Fix errors
I agree with the unnecessary code duplication and combined the two functions Regarding the complexity of the SQL query: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't run the code yet, but here are a few comments that you can address already. ;)
elabftw#1993 (review) Throw exception with Tools::error() function. Use logical or (||) operator. Use single quote and concatenation.
Use sprintf as e.g. in AbstractEntity->getReadSqlBeforeWhere()
RP from elabftw/elabftw
Return an array that contains an array for experiments and one for items. Uses associative array destructuring.
Hi Nicolas, |
Hello Marcel, Sorry I kinda forgot this PR... It got drowned by the dependencies PRs... Thanks for reminding me. I'll look into it thoroughly asap! |
Thank you for your contribution! |
Hi Nicolas,
I tried to address the feature request as described in issue #1432.
For database items with many related items/experiments the long list of related entities might not be what a user wants and more features need to be added to reduce the amount.
However, I'm curious about your thoughts.