You are here

public function EntityUpdateExec::submitFormRescue in Entity Update 8

Same name and namespace in other branches
  1. 2.0.x src/Form/EntityUpdateExec.php \Drupal\entity_update\Form\EntityUpdateExec::submitFormRescue()

Run rescue entities.

File

src/Form/EntityUpdateExec.php, line 269

Class

EntityUpdateExec
Class CheckEntityUpdate.

Namespace

Drupal\entity_update\Form

Code

public function submitFormRescue(array &$form, FormStateInterface $form_state) {
  try {
    $res = EntityUpdate::entityUpdateDataRestore();
    $res_str = $res ? 'SUCCESS' : 'FAIL';
    $status = $res ? 'status' : 'error';
    drupal_set_message($this
      ->t("Entity rescue @res", [
      '@res' => $res_str,
    ]), $status);
  } catch (\Exception $e) {
    drupal_set_message($this
      ->t("Entity update Fail"), 'error');
    drupal_set_message($e
      ->getMessage(), 'error');
  }
}