Because it does not return the status of the saved key.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | key-entity_forms_updates-3048562-4.patch | 3.24 KB | aaronbauman |
| #2 | parent-3048562-2.patch | 1.52 KB | sergiu stici |
Because it does not return the status of the saved key.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | key-entity_forms_updates-3048562-4.patch | 3.24 KB | aaronbauman |
| #2 | parent-3048562-2.patch | 1.52 KB | sergiu stici |
Comments
Comment #2
sergiu stici commentedHere is the patch, please review.
Comment #3
jcnventuraI'm pretty sure it still doesn't return the status. I think the proposed patch is not improving anything, as it saves the entity twice.
EntityForm::save(), which this class extends is defined as:
Instead of just calling
parent::save($form, $form_state);at the beginning (which saves the entity for the first time), delete all the lines before and inside the try (which are saving the entity for the second time). Replace the current try body with$status = parent::save($form, $form_state);. Oh, and then add a return $status at the end of the call, of course.I haven't checked the code for the other two functions where the patch is calling the base class, but it is very likely that similar changes have to be made.
Comment #4
aaronbaumanHere's a reworking of the patch:
1) removes the
submitForm()method fromKeyConfigOverrideDeleteFormin favor ofgetDeletionMessage()2) implements
getDeletionMessage()inKeyDeleteForm3) update
KeyFormBase::save()to remove the try/catch, sinceEntityFormInterfacedoes not accommodate returningNULL.also replace
drupal_set_message()withmessenger()FWIW, many core implementations return void in violation of
EntityFormInterface, and also do not perform any exception handling:\Drupal\node\NodeForm::save,\Drupal\menu_ui\MenuForm::save,\Drupal\media\MediaTypeForm::save,\Drupal\workflows\Form\WorkflowEditForm::save, etc.Comment #5
jcnventuraComment #6
rlhawkThis is terrific. Thanks, all.
Comment #8
rlhawk