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

/api/Sharing::List Error #781

Closed
Tracked by #634
nickelsound opened this issue Nov 9, 2020 · 4 comments
Closed
Tracked by #634

/api/Sharing::List Error #781

nickelsound opened this issue Nov 9, 2020 · 4 comments
Labels
bug Something isn't working High Priority High priority issues

Comments

@nickelsound
Copy link
Contributor

Detailed description of the problem [REQUIRED]

Call /api/Sharing::List doesn't work for non admin user (it works fine for admin). Calls ends with rc 500. The log: [2020-11-09 09:55:20] production.ERROR: Undefined property: stdClass::$parent_id {"exception":"[object] (ErrorException(code: 0): Undefined property: stdClass::$parent_id at /var/www/html/Lychee/app/Models/Album.php:269)
[stacktrace]
#0 /var/www/html/Lychee/app/Models/Album.php(269): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /var/www/html/Lychee/app/Http/Controllers/SharingController.php(78): App\Models\Album::getFullPath()
#2 /var/www/html/Lychee/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(230): App\Http\Controllers\SharingController->App\Http\Controllers\{closure}()
#3 /var/www/html/Lychee/app/Http/Controllers/SharingController.php(79): Illuminate\Support\Collection->each()
#4 [internal function]: App\Http\Controllers\SharingController->listSharing().

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. Go to the main screen as a non-admin user
  2. Create an album
  3. Leave it private
  4. Go to sharing and share the album to someone.
  5. The previous step should fail
  6. Click on 'Sharing' in the menu causes a 500 error from now on.

Output of the diagnostics [REQUIRED]

Diagnostics
-------
Warning: You may experience problems when uploading a photo of large size. Take a look in the FAQ for details.
Warning: Dropbox import not working. dropbox_key is empty.

System Information
--------------
Lychee Version (git):            master (5ebde6d) - Up to date (12 hours ago).
DB Version:                      4.0.7

composer install:                --no-dev
APP_ENV:                         production
APP_DEBUG:                       false

System:                          Linux
PHP Version:                     7.4
Max uploaded file size:          20M
Max post size:                   100M
MySQL Version:                   10.0.38-MariaDB-0ubuntu0.16.04.1

Imagick:                         1
Imagick Active:                  1
Imagick Version:                 1673
GD Version:                      2.3.0



Config Information
--------------
version:                         040007
check_for_updates:               0
sorting_Photos_col:              takestamp
sorting_Photos_order:            ASC
sorting_Albums_col:              max_takestamp
sorting_Albums_order:            ASC
imagick:                         1
skip_duplicates:                 0
small_max_width:                 0
small_max_height:                360
medium_max_width:                1920
medium_max_height:               1080
lang:                            cz
layout:                          0
image_overlay:                   0
image_overlay_type:              desc
default_license:                 none
compression_quality:             90
full_photo:                      1
delete_imported:                 0
Mod_Frame:                       1
Mod_Frame_refresh:               30
thumb_2x:                        1
small_2x:                        1
medium_2x:                       1
landing_page_enable:             0
landing_owner:                   Pavel Lukes
landing_title:                   Pavel Lukes
landing_subtitle:                Fotky
landing_facebook:                
landing_flickr:                  
landing_twitter:                 
landing_instagram:               
landing_youtube:                 
landing_background:              dist/cat.jpg
site_title:                      Fotky
site_copyright_enable:           0
site_copyright_begin:            2019
site_copyright_end:              2019
additional_footer_text:          
display_social_in_gallery:       0
public_search:                   0
SL_enable:                       0
SL_for_admin:                    0
public_recent:                   0
recent_age:                      1
public_starred:                  0
downloadable:                    0
photos_wraparound:               1
map_display:                     1
zip64:                           1
map_display_public:              0
map_provider:                    Wikimedia
force_32bit_ids:                 0
map_include_subalbums:           0
update_check_every_days:         3
has_exiftool:                    0
share_button_visible:            0
import_via_symlink:              0
has_ffmpeg:                      1
location_decoding:               1
location_decoding_timeout:       30
location_show:                   1
location_show_public:            0
rss_enable:                      0
rss_recent_days:                 7
rss_max_items:                   100
prefer_available_xmp_metadata:   0
editor_enabled:                  1
lossless_optimization:           0
swipe_tolerance_x:               150
swipe_tolerance_y:               250
local_takestamp_video_formats:   .avi|.mov
log_max_num_line:                1000

Browser and system

Chromium: 86.0.4240.183 (64bit)
Windows 10

@ildyria ildyria added bug Something isn't working High Priority High priority issues labels Nov 9, 2020
ildyria added a commit that referenced this issue Nov 9, 2020
@ildyria
Copy link
Member

ildyria commented Nov 9, 2020

Will be fixed once the CI passes on the PR.

Thank you for pointing that one.

@ildyria
Copy link
Member

ildyria commented Nov 9, 2020

The fact we never had bug report on that one is quite surprising.
It really shows how many people use the (bad) user-sharing capabilities of Lychee. 😅

@kamil4
Copy link
Contributor

kamil4 commented Nov 9, 2020

I'm guessing it worked at some point... I'm sure I have tested album sharing between users in the past, although perhaps I always configured the sharing as admin?

Either way, I agree it's an issue due to our incomplete regression tests coverage...

@ildyria
Copy link
Member

ildyria commented Nov 9, 2020

I'm sure I have tested album sharing between users in the past

No, this was broken when the parent was added to differentiate multiple albums with the same name. But I don't remember if it was you or me who added that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working High Priority High priority issues
Projects
None yet
Development

No branches or pull requests

3 participants