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

Sharing not working for PostgreSQL #265

Closed
fcr-- opened this issue Mar 21, 2021 · 0 comments
Closed

Sharing not working for PostgreSQL #265

fcr-- opened this issue Mar 21, 2021 · 0 comments
Labels
bug Something isn't working
Projects

Comments

@fcr--
Copy link

fcr-- commented Mar 21, 2021

Describe the bug
When I click "Add share" on a photo: it runs a wrong query and generates an error:

2021-03-21 01:51:02.978 UYT [14948] fran@photoview ERROR:  falta una entrada para la tabla «album» en la cláusula FROM en carácter 687
2021-03-21 01:51:02.978 UYT [14948] fran@photoview SENTENCIA:  SELECT "media"."id","media"."created_at","media"."updated_at","media"."title","media"."path","media"."path_hash","media"."album_id","media"."exif_id","media"."date_shot","media"."type","media"."video_metadata_id","media"."side_car_path","media"."side_car_hash","Album"."id" AS "Album__id","Album"."created_at" AS "Album__created_at","Album"."updated_at" AS "Album__updated_at","Album"."title" AS "Album__title","Album"."parent_album_id" AS "Album__parent_album_id","Album"."path" AS "Album__path","Album"."path_hash" AS "Album__path_hash" FROM "media" LEFT JOIN "albums" "Album" ON "media"."album_id" = "Album"."id" WHERE (EXISTS (SELECT * FROM user_albums WHERE user_albums.album_id = Album.id AND user_albums.user_id = $1)) AND "media"."id" = $2 ORDER BY "media"."id" LIMIT 1

The root issue here is that postgresql converts tables and column names to lowercase if they are not quoted, and Album is indeed missing quotes there. I think this same issue was happening on other places and fixed here, but I guess it needs to be fixed here as well...

To Reproduce
Steps to reproduce the behavior:

  1. Go to any photo
  2. Click on Add share
  3. See error

Expected behavior
I guess it should give me a sharing link

Screenshots
image

Your environment:

  • Are you using Docker? [yes / no]
    • no
  • Database [e.g. mariadb 10.5]
    • postgresql 9.6
  • Browser [e.g. chrome, safari]
    • firefox
  • Version [e.g. 2.0.0]
    • 86

Additional context
As I'm not using a docker image, instead I built api and ui separately and then copied into the output directory as suggested here: https://photoview.github.io/docs/installation-manual/, btw the parameter for PHOTOVIEW_PUBLIC_ENDPOINT should be removed from that document, and it's missing the "fix ui/.env" step before running the ui build; but this is unrelated to the bug.

@fcr-- fcr-- added the bug Something isn't working label Mar 21, 2021
@viktorstrate viktorstrate added this to To do in Roadmap via automation Mar 21, 2021
@viktorstrate viktorstrate moved this from To do to Before next release in Roadmap Mar 21, 2021
Roadmap automation moved this from Before next release to Done Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant