LycheeOrg / Lychee

A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.
https://lycheeorg.github.io/
MIT License
3.35k stars 299 forks source link

Share button does nothing #1674

Closed icsy7867 closed 1 year ago

icsy7867 commented 1 year ago

Detailed description of the problem [REQUIRED]

Just installed the latest docker container to test out lychee. Everything seems to work great! However, I am looking for a way to implement some images in another tool/program, and I really need an easy access share/link.

After installing and setting up, I added a few various images to various albums (Some in the public one and in others). However when I do, nothing happens. All other icons/buttons seem to work as intended.

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. Install the latest docker container. (I used v4.6.5)
  2. setup admin account per normal, and upload some folders
  3. Click the share gear/button after selecting a specific image
  4. Nothing happens... it highlights with a click/mouseover. But no menu or anything

As a side note, I assume the popovers are javascript or bootstrap based, but I see no errors in the console.

Screenshots

image

Output of the diagnostics [REQUIRED]

    Diagnostics
    -------
    Warning: Dropbox import not working. dropbox_key is empty.
    Warning: Default timezone not properly set; you might experience strange results when importing photos without explicit EXIF timezone
    Warning: git (software) is not available.
    Foreign key: albums.id                      → base_albums.id       : NO ACTION
    Foreign key: base_albums.owner_id           → users.id             : NO ACTION
    Foreign key: photos.album_id                → albums.id            : NO ACTION
    Foreign key: photos.owner_id                → users.id             : NO ACTION
    Foreign key: size_variants.photo_id         → photos.id            : NO ACTION
    Foreign key: sym_links.size_variant_id      → size_variants.id     : NO ACTION
    Foreign key: tag_albums.id                  → base_albums.id       : NO ACTION
    Foreign key: user_base_album.base_album_id  → base_albums.id       : CASCADE
    Foreign key: user_base_album.user_id        → users.id             : CASCADE

    System Information
    --------------
    Lychee Version (git):                    ?? (26b5393) -- Could not compare.
    DB Version:                              4.6.5

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

    System:                                  Linux
    PHP Version:                             8.1.12
    PHP User agent:                          Lychee/4 (https://lycheeorg.github.io/)
    Timezone:                                UTC
    Max uploaded file size:                  100M
    Max post size:                           100M
    Max execution time:                      3600
    SQLite Version:                          3.40.0

    exec() Available:                        yes
    Imagick Available:                       1
    Imagick Enabled:                         1
    Imagick Version:                         1691
    GD Version:                              2.3.3
    Number of foreign key:                   9 found.

    Config Information
    --------------
    version:                                 040605
    check_for_updates:                       0
    sorting_photos_col:                      taken_at
    sorting_photos_order:                    ASC
    sorting_albums_col:                      max_taken_at
    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:                                    en
    layout:                                  1
    image_overlay_type:                      desc
    default_license:                         none
    compression_quality:                     90
    grants_full_photo_access:                1
    delete_imported:                         0
    mod_frame_enabled:                       1
    mod_frame_refresh:                       30
    thumb_2x:                                1
    small_2x:                                1
    medium_2x:                               1
    landing_page_enable:                     0
    site_owner:                              John Smith
    landing_title:                           John Smith
    landing_subtitle:                        Cats, Dogs & Humans Photography
    sm_facebook_url:                         https://www.facebook.com/JohnSmith
    sm_flickr_url:                           https://www.flickr.com/JohnSmith
    sm_twitter_url:                          https://www.twitter.com/JohnSmith
    sm_instagram_url:                        https://instagram.com/JohnSmith
    sm_youtube_url:                          https://www.youtube.com/JohnSmith
    landing_background:                      dist/cat.webp
    site_title:                              Lychee v4
    footer_show_copyright:                   1
    site_copyright_begin:                    2019
    site_copyright_end:                      2019
    footer_additional_text:                  
    footer_show_social_media:                0
    public_search:                           0
    SL_enable:                               0
    SL_for_admin:                            0
    public_recent:                           0
    recent_age:                              1
    public_starred:                          0
    grants_download:                         0
    photos_wraparound:                       1
    map_display:                             0
    zip64:                                   1
    map_display_public:                      0
    map_provider:                            Wikimedia
    force_32bit_ids:                         0
    map_include_subalbums:                   0
    update_check_every_days:                 3
    has_exiftool:                            1
    share_button_visible:                    0
    import_via_symlink:                      0
    has_ffmpeg:                              1
    location_decoding:                       0
    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
    unlock_password_photos_with_url_param:   0
    nsfw_visible:                            1
    nsfw_blur:                               0
    nsfw_warning:                            0
    nsfw_warning_admin:                      0
    nsfw_banner_override:                    
    map_display_direction:                   1
    album_subtitle_type:                     oldstyle
    upload_processing_limit:                 4
    public_photos_hidden:                    1
    new_photos_notification:                 0
    legacy_id_redirection:                   1
    zip_deflate_level:                       6
    SA_enabled:                              1
    default_album_protection:                1
    allow_username_change:                   1

Browser and system

Chrome - MacOS

grainsoflight commented 1 year ago

Second this. Also, "download" and "Public" do not remain active after turning them on

yuorfaec commented 1 year ago

Also seeing this on my fresh upgrade to 6ca3066/4.6.5. Also was forced to upgrade to PHP 8.1 (also seen in #1670). Server is running ubuntu 20.04 and I reproduced this issue on Win10 Firefox, Chrome, and Android 13 Firefox.

qwerty287 commented 1 year ago

Can you check the browser console for errors?

yuorfaec commented 1 year ago

There's a source map error when I load my site, but the same errors display on the demo site. When I click the share button, nothing happens in the UI or the console. In the [url]/api/Albums::get post response JSON, I don't see the "share button visible" attribute in either the policy or rights headers. I do see them in the demo site. image of my site's JSON post

qwerty287 commented 1 year ago

Yes, this attribute was removed and is no longer sent. Source map errors are some kind of expected and not related.

yuorfaec commented 1 year ago

Yeah, changing the 'share button visible' setting in the config screen seems to do nothing now. I don't see any documentation for the 'default album protection' setting, though, and setting it to 0 caused an internal error that prevented me from saving. The logs say it was expecting 1, 2, or 3...maybe this new setting is preventing share links?

I saw these entries in the log from shortly after I upgraded but I have so far been unable to recreate it. Possibly related? error -- Illuminate\Routing\AbstractRouteCollection::handleMatchedRoute -- 44 -- error -- App\Http\Middleware\FixStatusCode::handle -- 30 -- ; caused by

ildyria commented 1 year ago

default album protection

This is when you create a new album, the protection policy is either full private (as currently), inherit from parent or full public (hence directly visible by any anonymous user).

oblomow commented 1 year ago

Same here. Using the 'share photo' button on a single image does not work. Nothing happens. Latest version: System Information

Lychee Version (git):                    master (2902bee) -- Up to date (22 hours ago).
DB Version:                              4.6.5

Annoying bug, since I use Lychee to share photos to external (photo-)websites.

icsy7867 commented 1 year ago

I sort of figured out part of the isssue.

contextMenu.sharePhoto = function (photoID, e) {
    if (!lychee.share_button_visible) {
        return;
    }

If you change this to:

contextMenu.sharePhoto = function (photoID, e) {
    if (false) {
        return;
    }

It magically starts to work:

image

So it looks like if you set that variable manually it all should start working: https://lycheeorg.github.io/docs/settings.html#share_button_visible

Interestingly... setting the variable in settings -> more did not resolve it. That variable still seems to be triggering a false.

image
oblomow commented 1 year ago

correct. the share menu automagically appears.

icsy7867 commented 1 year ago

Additional details... looking at the code, it looks like this is statically set:

from chrome console:

<img width="450" alt="image" src="https://user-images.githubusercontent.com/3788162/210442470-f2a1f704-9679-40b3-91e4-8f2e49dc864c.png">
var lychee = {
    /**
  * The version of the backend in human-readable
  * @type {Version}
  */
    version: null,

    updateGit: "https://github.com/LycheeOrg/Lychee",
    updateURL: "https://github.com/LycheeOrg/Lychee/releases",
    website: "https://LycheeOrg.github.io",

    publicMode: false,
    viewMode: false,
    grants_full_photo_access: true,
    grants_download: false,
    public_photos_hidden: true,
    share_button_visible: false,
oblomow commented 1 year ago

Looks like this requires some input from the developers. They are usually pretty quick to react.

oblomow commented 1 year ago

fixed. thanks!

icsy7867 commented 1 year ago

Just tested the newly pushed docker container: testing-3863451196

Working!

oblomow commented 1 year ago

looks like the problem is back in the latest update.

tiritibambix commented 1 year ago

I'm using Lychee 4.7.0 and have the same problem. I can't share my albums