Open KlausIllmayer opened 1 year ago
sorry that I missed this question before... I agree with you that the error encountered is very misleading.
Because also of #172 - one option, from my point of view could be that clicking on "save as draft" or "submit" would lead to a deletion of all the empty fields/properties in the edit form, this way the form would be "cleaner", more readable and the only red warning appearing could event remain at the bottom of the page. At the same time, it could also lead to some frustration for a user who just wanted to save but keep the recommended fields available/pre-selected.
An alternative could be to change the red pop-up message to include the error message from backend, that would need a reformulation. From "Repeated relation to object with id 87wJWo" to "Related items error: only one relation can be created with a given item - id 87wJWo." or something alike.
after discussion, decision to show the error message in the pop-up at the bottom of the page.
need to create a related backend issue to change the error message received and make it a bit clearer.
Regarding the "fields must not be empty" messages, see #172
Some potential errors are already covered in frontend before saving a new item, be it that it is not possible to do some stuff by design or giving an immediate warning, when e.g. a value is missing. But we also have some errors coming from backend, that are uncaught by frontend. One example that I recently discovered is this one: Creating a new item and adding two relations, that point to the same item, e.g. creating a relation of type "Relates to" to the tool "Gephi" (persistent-id: 87wJWo) and one relation of type "Documents" also to the tool "Gephi" (persistent-id: 87wJWo). This results after trying to save the new item in an error from backend: "Repeated relation to object with id 87wJWo".
The way how this is expressed in frontend is not ideal, because the error is at the end of the quite long edit form. Trying to save gives me in the bottom left the label that an error happend but without any information on the cause of the error. And due to the pre-populated fields it will jump to the first one, that is not filled out, which looks like as the error is coming from here. This is how it looks like after I press on "Save as draft":
I get the wrong assumption, that the cause of the error is because I didn't fill out all of this fields. But the error that caused the problem is explained at the end of the edit form, where I get only after scrolling to it (and potentially trying to solve all the errors with "Field must not be empty"):
Only here I see the real error, that additionally is also not the best text to express the cause (but that would be an issue of backend).
In this case, frontend could catch the issue beforehand, but that must be implemented. Instead my point here is that we would need a better way to point users to the real cause of an error. The users should see the error at first and it should be possible to copy & paste it. Also additional, a timestamp and an information that they should report this error including the timestamp and the error message would be very helpful for our support work.
More a general discussion, including @laureD19, @kreetrapper, @stefanprobst