Commit b1e36444 authored by catch's avatar catch

Issue #2355187 by ashutoshsngh, rpayanm, skipyT, legolasbo: Remove form_get_cache().

parent 57b92f29
......@@ -17,30 +17,6 @@
use Drupal\Core\Template\Attribute;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
* Fetches a form from the cache.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal::formBuilder()->getCache().
*
* @see \Drupal\Core\Form\FormCacheInterface::getCache().
*/
function form_get_cache($form_build_id, FormStateInterface $form_state) {
return \Drupal::formBuilder()->getCache($form_build_id, $form_state);
}
/**
* Stores a form in the cache.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal::formBuilder()->setCache().
*
* @see \Drupal\Core\Form\FormCacheInterface::setCache().
*/
function form_set_cache($form_build_id, $form, FormStateInterface $form_state) {
\Drupal::formBuilder()->setCache($form_build_id, $form, $form_state);
}
/**
* Retrieves, populates, and processes a form.
*
......
......@@ -61,7 +61,7 @@ function testCacheToken() {
\Drupal::formBuilder()->setCache($this->form_build_id, $this->form, $this->form_state);
$cached_form_state = new FormState();
$cached_form = form_get_cache($this->form_build_id, $cached_form_state);
$cached_form = \Drupal::formBuilder()->getCache($this->form_build_id, $cached_form_state);
$this->assertEqual($this->form['#property'], $cached_form['#property']);
$this->assertTrue(!empty($cached_form['#cache_token']), 'Form has a cache token');
$this->assertEqual($this->form_state->get('example'), $cached_form_state->get('example'));
......
......@@ -41,9 +41,10 @@ public function twoFormInstances() {
* Emulate legacy AHAH-style ajax callback.
*
* Drupal 6 AHAH callbacks used to operate directly on forms retrieved using
* form_get_cache and stored using form_set_cache after manipulation. This
* callback helps testing whether \Drupal::formBuilder()->setCache() prevents
* resaving of immutable forms.
* \Drupal::formBuilder()->getCache() and stored using
* \Drupal::formBuilder()->setCache() after manipulation. This callback helps
* testing whether \Drupal::formBuilder()->setCache() prevents resaving of
* immutable forms.
*/
public function storageLegacyHandler($form_build_id) {
$form_state = new FormState();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment