/** * Form submission handler for the 'cancel' action. * * @param array $form * An associative array containing the structure of the form. * @param array $form_state * A reference to a keyed array containing the current state of the form. */ public function cancel(array $form, array &$form_state) { // Remove this view from cache so edits will be lost. $view = $this->entity; $this->tempStore->delete($view->id()); $form_state['redirect_route']['route_name'] = 'views_ui.list'; }
/** * Form submission handler for the 'cancel' action. * * @param array $form * An associative array containing the structure of the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ public function cancel(array $form, FormStateInterface $form_state) { // Remove this view from cache so edits will be lost. $view = $this->entity; $this->tempStore->delete($view->id()); $form_state->setRedirect('views_ui.list'); }
/** * Tests the delete() method with no lock available. * * @covers ::delete() * @expectedException \Drupal\user\TempStoreException */ public function testDeleteWithNoLockAvailable() { $this->lock->expects($this->at(0))->method('acquire')->with('test')->will($this->returnValue(FALSE)); $this->lock->expects($this->at(1))->method('wait')->with('test'); $this->lock->expects($this->at(2))->method('acquire')->with('test')->will($this->returnValue(FALSE)); $this->keyValue->expects($this->once())->method('getCollectionName'); $this->tempStore->delete('test'); }
/** * {@inheritdoc} */ public function submit(array $form, FormStateInterface $form_state) { $this->tempStore->delete($this->entity->id()); $form_state->setRedirectUrl($this->entity->urlInfo('edit-form')); drupal_set_message($this->t('The lock has been broken and you may now edit this view.')); }
/** * {@inheritdoc} */ public function submit(array $form, array &$form_state) { $this->tempStore->delete($this->entity->id()); $form_state['redirect_route'] = $this->entity->urlInfo('edit-form'); drupal_set_message($this->t('The lock has been broken and you may now edit this view.')); }