I am using a BeforeSave hook to validate/process edits made in the front-end.
Here is the sequence of events:
I click on the detail field pencil icon to start editing a field.
After entering new value, I click on <Update> button.
The back-end rejects the edit with an Error exception as follows:
The error is shown in UI and the edit does not complete.
At this point the new value is in the field input still in edit mode.
I click on the <Cancel> button.
The field does NOT revert to the original value.
If I refresh the page, now the field shows the original value since edit was never saved.
Shouldn't the UI restore the original value in this situation?
Here is the sequence of events:
I click on the detail field pencil icon to start editing a field.
After entering new value, I click on <Update> button.
The back-end rejects the edit with an Error exception as follows:
PHP Code:
// generate UI error message
throw Error::createWithBody(
$error->getMessage(),
Body::create('Update Error: ' . $error->getMessage())->encode()
);
At this point the new value is in the field input still in edit mode.
I click on the <Cancel> button.
The field does NOT revert to the original value.
If I refresh the page, now the field shows the original value since edit was never saved.
Shouldn't the UI restore the original value in this situation?
Comment