Problem/Motivation

In the process of triaging issue #2823541: Table clicksort is lost when using views exposed filter @xjm and I encountered another problem relating to the views exposed block form where the options and/or widgets displayed on the exposed block were not immediately visible on the view page after changing the configuration of the view itself.

To reproduce the issue:

  1. Add some content into a default new standard profile 8.4.x HEAD D8 site
  2. Create a page view (with URL /sortmissing), add exposed filters for sorting criteria (eg. content type for filter and authored on, authored by, for sort criteria)
  3. Add a full pager with exposed option "Allow user to control the number of items displayed in this view"
  4. Under Advanced config of the view, select Yes for Exposed Form, choosing Basic form type
  5. Under Structure - Block Layout - Place Block choose the newly created exposed form and place it in a region (eg. Sidebar)
  6. Go the view page (/sortmissing), notice which options and widgets are shown
  7. Change the view and add another option into an existing filter (eg. add Title to the Sort Criteria so that you have three options: authored on, authored by and title as options there)
  8. Switch back to view page and just refresh the page or click Apply on the exposed block form to refresh the display - the resulting page does not show the newly added option

Based on how unpredictable the display of the exposed block options happens as it eventually refreshes after a few attempts clicking on the page and the various options (usually after 3-4 refreshes of changing the chosen filtering options things seem to update), this would possibly be related to caching and how the cache is being invalidated on the exposed filters block for the view.

Attached with the issue is the export of the view I've used to arrive at the issue.

- - - - - - - - - - - - - -

This issue emerged from #2823541: Table clicksort is lost when using views exposed filter and the following folks deserve credit:
@anneeasterling = #2823541-9: Table clicksort is lost when using views exposed filter
@krknth = #2823541-10: Table clicksort is lost when using views exposed filter

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

samirjusic created an issue. See original summary.

samirjusic’s picture

I searched through the existing views issues list for 8.4.x, but could not find an existing bug reported so I'm raising the new one here.

stpaultim’s picture

Working on Major Issues Triage at Twin Cities Drupal Camp with @mathuaerknedam (mentored by @YesCT)

This issue appears to have emerged from #2823541: Table clicksort is lost when using views exposed filter and the following folks deserve credit:
@anneeasterling = #2823541-9: Table clicksort is lost when using views exposed filter
@krknth = #2823541-10: Table clicksort is lost when using views exposed filter

stpaultim’s picture

Issue summary: View changes
Issue tags: +TCDrupal 2017
stpaultim’s picture

Issue summary: View changes

xjm’s picture

Added credit for anneeasterling who originally identified this issue. krknth reproduced the other issue but did not identify this one, so they'll receive credit for the other. Thanks @StPaulTim!

micbar’s picture

I have an exposed filters form on a block which contains a list of taxonomy terms. If I add a new term to the vocabulary, the exposed filters form does not get updated. Digging into the block object shows only one cache context "languages:language_interface" and no cache tags. Is that use case (taxonomy terms in exposed filters form) not working by default and needs some tweaking or is it a bug in the views module?

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Lendude’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: +Needs tests
FileSize
782 bytes

@micbar that sounds like #2900248: Exposed term filter is not updated when terms are added, deleted, or rearranged (caching issue?), not sort criteria which this issue is talking about.

I can reproduce this issue, but took me a while to see that the essential point here is that it is about the 'Exposed form in block:Yes' block.

Fix in the patch fixes it for me when manually testing, but this obviously still needs tests.

And is there any way to get the tag 'config:views.view.' . $this->view->id() from the View and not have to build it yourself? Couldn't find anything.