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

A new bench could be saved without some of the images and without warning. #168

Closed
arizonagroovejet opened this issue Oct 3, 2018 · 2 comments

Comments

@arizonagroovejet
Copy link
Contributor

Steps to recreate:

  • Click "Add new Bench" button.
  • Select image A which is a photo of an inscription.
  • Select image B which is a photo of the bench.
  • Click "Share Bench" button.
  • Click "Add new Bench" button.
  • Select image C which is a photo of an inscription.
  • Select image B for whatever reason. Accidents happen.
  • Click "Share Bench" button.

Expected (? Desired?) results:
The bench does not get submitted. Some sort of message appears informing that image B has already been submitted and the user has a chance to correct the issue.

Actual results:
The bench is successfully submitted without any indication of there being a problem. Image B doesn't show up on the bench page. User probably wonders why there's only one photo on their submission instead of two.

I haven't experienced this issue, I suspected it's existence whilst reading the code and then confirmed it using a local instance of the OpenBenches code.

The save_image() function returns some text if asked to save a duplicate image, but in add.php that text isn't assigned to a variable for three of the calls to save_image()
https://github.com/edent/openbenches/blob/8ea9be3cc73a5b503f181226cfffb7cf2b0c8ed3/www/add.php#L54
https://github.com/edent/openbenches/blob/8ea9be3cc73a5b503f181226cfffb7cf2b0c8ed3/www/add.php#L67
https://github.com/edent/openbenches/blob/8ea9be3cc73a5b503f181226cfffb7cf2b0c8ed3/www/add.php#L74

By contrast, in edit.php the output of save_image() is always assigned and an error message built up and displayed
https://github.com/edent/openbenches/blob/8ea9be3cc73a5b503f181226cfffb7cf2b0c8ed3/www/edit.php#L56
https://github.com/edent/openbenches/blob/8ea9be3cc73a5b503f181226cfffb7cf2b0c8ed3/www/edit.php#L95
Possibly the fix is do what edit.php does in add.php. 🤷‍♂️

@edent
Copy link
Collaborator

edent commented Oct 5, 2018

Yes, I think that's a good idea.

@edent
Copy link
Collaborator

edent commented Jul 29, 2023

The new version of the code will allow the same photo to be uploaded to multiple benches. The reduces the number of errors users see, and makes the logic a lot easier. If they notice they've made a mistake they can delete the bench and start again.

I occasionally run a check to see an image has been attached to multiple benches. It only happens rarely.

@edent edent closed this as completed Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants