harvard-lil / h2o

H2O is a web app for creating and reading open educational resources, primarily in the legal field
https://opencasebook.org
GNU Affero General Public License v3.0
35 stars 30 forks source link

Publish modal is incorrectly blocking publication on description check #2023

Open lizadaly opened 1 year ago

lizadaly commented 1 year ago

Reported by a user:

The message says adding a "description" is optional. I don't think I need additional description, but I can't publish until I put text in the description box. Every time I click the publish button, the interface does not react. It won't permit me to publish without a description. So, I guess the description is not optional. I went back and placed two blank spaces in the description box and then it allowed me to publish the changes to the casebook, including two (totally unnecessary) blank spaces in the description box.

lizadaly commented 1 year ago

I was eventually able to to reproduce this, but I don't think it's fixable because it's a side effect of the H2O draft/revision model. We could probably catch the error differently, though explaining what to do next would be complicated.

What happened here is that the user created a draft, worked on it, and then accidentally went back to the published version, clicked "publish", and got (behind the scenes) a permission error because the backend claimed that it wasn't able to transition between the state of published and published.

The user thinks they were able to fix it by changing the description field, but that's just because they probably got back to the correct draft URL in doing so.