Problem/Motivation

I was looking at some code related to views exposed forms and noticed something weird in Drupal\views\ExposedFormCache.
This class is supposed to set/get the form cache, but setForm method actually does this:

public function setForm($view_id, $display_id, array $form_output) {
  // Save the form output.
  $views_exposed[$view_id][$display_id] = $form_output;
}

As a result, getForm is always return FALSE.

Proposed resolution

Let's make it work.

Remaining tasks

Review, commit.

Issue fork drupal-3198152

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Matroskeen created an issue. See original summary.

matroskeen’s picture

Issue summary: View changes
Status: Active » Needs review

Curious to see if it breaks something :)

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

matroskeen’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#2913497: ExposedFormCache invalid logic

Lol, turns there is a duplicated issue, created a while ago: #2913497: ExposedFormCache invalid logic.
I should have checked better at that time. Closing :)