Problem/Motivation

Original problem report, as amended by @mpp:

  • Create a paged view with an exposed block and expose the "items per page" option to allow a user to change the amount of results.
  • When applying a sort on the view and then changing the amount of items per page, the sort is lost.

Steps to reproduce:

  1. Installed fresh drupal(8.4.x), enabled devel, devel_generate modules
  2. Generated 50 contents(page, articles) from devel generate page -'/admin/config/development/generate/content'
  3. Created view page '/test' & select Title, Id fields
  4. Selected table format & enabled Title, Id as sort-able in it's table settings
  5. Selected Pager as full, and in it's settings checked 'Allow user to control the number of items displayed in this view' under 'EXPOSED OPTIONS' section
  6. Under Advanced settings, enabled 'Exposed form in block' option (Yes). And saved the view
  7. Next, i'v enabled this filter block from block layout page in one of the region & only for '/test' page
  8. Now, i visited '/test' page and clicked on title to sort it. Results came as expected & url is - http://d8.dev/test?items_per_page=5&order=title&sort=asc
  9. Next, from the block filter i'v changed no.of items to 25 & clicked apply. Results came only for this filter But sort queries gone in the url. url is - http://d8.dev/test?items_per_page=25

Also see this related issue which may be encountered when testing this bug: #2887144: Views exposed form block options are not updated immediately when adding additional sorts, filters, etc (Caching?).

Proposed resolution

Atm the views exposed form filters out get parameters in ViewsExposedForm::buildForm:

$form['#action'] = $view->hasUrl() ? $view->getUrl()->toStrin- g() : Url::fromRoute('<current>')->toString();

A quick workaround would be to alter the exposed block form to add current sort & order query parameters.

Remaining tasks

User interface changes

(New or changed features/functionality in the user interface, modules added or removed, changes to URL paths, changes to user interface text.)

API changes

(API changes/additions that would affect module, install profile, and theme developers, including examples of before/after code if appropriate.)

Data model changes

(Database or configuration data changes that would make stored data on an existing site incompatible with the site's updated codebase, including changes to hook_schema(), configuration schema or keys, or the expected format of stored data, etc.)

Original report by [username]

(Text of the original report, for legacy issues whose initial post was not the issue summary. Use rarely.)

CommentFileSizeAuthor
#99 2823541-99-rerolled-on-11.2.4.patch28.66 KBrsych
#95 2823541-rerolled-on-11.2.4.patch25.78 KBrsych
#92 2823541-rerolled-on-10.4.x.patch36.5 KBafsch
#88 2823541-rerolled-on-10.3.x.patch36.49 KBlovejit_singh
#86 2823541-rerolled-on-10.2.x.patch36.39 KBedmoreta
#81 2823541-81.patch35.25 KBberdir
#80 2823541-80-d9.5.patch37.11 KBberdir
#78 2823541-78.patch36.24 KBberdir
#77 2823541-nr-bot.txt149 bytesneeds-review-queue-bot
#76 2823541-76-d9.5.patch37.13 KBberdir
#74 2823541-74-d9.5.patch37.06 KBberdir
#72 2823541-72.patch36.25 KBberdir
#69 2823541-69-interdiff.txt721 bytesberdir
#69 2823541-69.patch37.17 KBberdir
#68 2823541-68-interdiff.txt1.23 KBberdir
#68 2823541-68.patch37.21 KBberdir
#66 interdiff_65-66.txt2.05 KBsuresh prabhu parkala
#66 2823541-66.patch37.64 KBsuresh prabhu parkala
#65 2823541-65.patch37.1 KBmegha_kundar
#62 reroll_diff_58_62.txt3.37 KBtim_dj
#62 2823541-62.patch37.14 KBtim_dj
#58 2823541-58.patch37.14 KBprimsi
#58 2823541-58.interdiff.txt11.25 KBprimsi
#55 interdiff-52-55.txt371 byteshardik_patel_12
#55 2823541-55--test-only.patch7.82 KBhardik_patel_12
#53 sort-persistance-bug.mov1.21 MBoknate
#52 2823541-52--test-only.patch7.83 KBoknate
#51 2823541-51.patch11.14 KBoknate
#51 2823541-51--test-only.patch7.68 KBoknate
#48 2823541-48.patch23.34 KBoknate
#48 2823541-48--test-only.patch19.91 KBoknate
#45 2823541-45.patch3.43 KBberdir
#44 2823541-44-interdiff.txt3.81 KBberdir
#44 2823541-44.patch3.63 KBberdir
#41 2823541-41.patch2.88 KBmbovan
#38 2823541-38.patch2.65 KBidebr
#34 interdiff-31-34.txt1.09 KBmarcoscano
#34 2823541-34.patch2.69 KBmarcoscano
#31 2823541-31.patch2.66 KBsamuel.mortenson
#12 views.view_.sortlost.yml.txt7.14 KBsamirjusic

Issue fork drupal-2823541

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

mpp created an issue. See original summary.

strykaizer’s picture

Havent tested yet, but this sounds like views exposed filters stripping out existing get parameters.
If this is the case, its a views exposed filter bug.

mpp’s picture

Project: Search API sorts » Drupal core
Version: 8.x-1.x-dev » 9.x-dev
Component: Code » views.module

I agree with StrykKaizer, ViewsExposedForm::buildForm removes existing get parameters:

$form['#action'] = $view->hasUrl() ? $view->getUrl()->toString() : Url::fromRoute('')->toString();
mpp’s picture

Version: 9.x-dev » 8.0.x-dev
mpp’s picture

Issue summary: View changes
dawehner’s picture

Version: 8.0.x-dev » 8.3.x-dev

Ideally we would fix it in 8.3.x/8.2.x

dawehner’s picture

Maybe we should have a special route which also contains the query parameters.

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

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

Anonymous’s picture

Issue tags: +FLDC17

Steps taken to confirm that this is still an issue:

  1. Created test site on simplytest.me, and created three pages (two Articles, one Blog; tagged with two different tags)
  2. Created Content view. Added exposed filters to allow filtering by Content type.
  3. Added Full pager with Exposed options to allow user to set number of results per page.
  4. Edited Advanced Settings to put Exposed form in block.
  5. Updated Block configuration to display Exposed form on the View page.
  6. Visited the View page and repeatedly changed the filter, sort and items-per-page.

Based on testing with this configuration, I was not able to replicate this issue. See video:
https://www.dropbox.com/s/xfdl27too26xvob/screencast_2017-02-19_14-37-09...

Issues observed (these are not related the reported issue, but I'm documenting here in case they may be related and/or helpful):

  • The page-per-item filter did not appear consistently. It does not appear unless there are arguments in the URL. After you click "Filter" button and there are arguments in the URL, the items-per-page select field appears.
  • The sort-by option did not populate properly under the same circumstances. (After you click "Filter" button and there are arguments in the URL, the second option for the select field finally appears.)

Summary: At this point, this bug is not confirmed. However, the exposed filter in a block doesn't appear to be working 100% correctly.

krknth’s picture

I'm able to reproduce this, here the steps i'v followed

  1. Installed fresh drupal(8.4.x), enabled devel, devel_generate modules
  2. Generated 50 contents(page, articles) from devel generate page -'/admin/config/development/generate/content'
  3. Created view page '/test' & select Title, Id fields
  4. Selected table format & enabled Title, Id as sort-able in it's table settings
  5. Selected Pager as full, and in it's settings checked 'Allow user to control the number of items displayed in this view' under 'EXPOSED OPTIONS' section
  6. Under Advanced settings, enabled 'Exposed form in block' option (Yes). And saved the view
  7. Next, i'v enabled this filter block from block layout page in one of the region & only for '/test' page
  8. Now, i visited '/test' page and clicked on title to sort it. Results came as expected & url is - http://d8.dev/test?items_per_page=5&order=title&sort=asc
  9. Next, from the block filter i'v changed no.of items to 25 & clicked apply. Results came only for this filter But sort queries gone in the url. url is - http://d8.dev/test?items_per_page=25
samirjusic’s picture

I'm working with @xjm on this in the Drupal Montreal Camp sprint and I'm trying to follow the steps from @krknth in #10 and @anneeasterling #9 so I could continue the work done so far.

samirjusic’s picture

StatusFileSize
new7.14 KB

@xjm and I went through the @anneeasterling #9 steps and were able to see the same behaviour @anneeasterling reported. In addition, and to rule out that as a potential source of problem, we added another option to the Sort By drop down (authored by field) and confirmed it worked as expected. I'd agree that we were not able to reproduce the originally reported issue.

@anneeasterling also mentioned:

The page-per-item filter did not appear consistently. It does not appear unless there are arguments in the URL. After you click "Filter" button and there are arguments in the URL, the items-per-page select field appears.

The sort-by option did not populate properly under the same circumstances. (After you click "Filter" button and there are arguments in the URL, the second option for the select field finally appears.)

We verified that there indeed exist an issue with the exposed filters block and how it is updated every time the list of fields to be shown is changed. Whenever a new element is added the exposed form block will take a few refreshes before it actually shows the new option in the dropdown (or whether the filtering option is shown/hidden altogether). It does not seem to be about whether there are parameters in the URL or not. For example

  1. Add a new filter criteria (eg. Title in addition to Content Type), save view
  2. Go to the view page and refresh without any parameters in the URL (or even with them) - the additional option in the exposed filter drop down does not appear immediately

(you can do the above if you are adding or removing an existing exposed filter option - perhaps Items Per Page item - and it will also take a few refreshes on the page before it kicks-in with the changes)

This might be a separate issue relating to cache invalidation of the exposed block. I'll try to see whether there is an existing issue reported.

I'm attaching the view that I've used to follow the steps and get to this point.

samirjusic’s picture

Issue summary: View changes

@xjm and I were able to follow the steps outlined in @krknth's comment #10 and saw the behaviour as what @krknth wrote there.

As per @xjm, there is most likely an existing issues somewhere in the views/contrib views issue queues that complains about this problem and has been there for some time now. I'll try and find something and report back here.

stpaultim’s picture

Issue tags: +TCDrupal 2017
stpaultim’s picture

Issue summary: View changes
mathuaerknedam’s picture

Issue summary: View changes
stpaultim’s picture

Issue summary: View changes
stpaultim’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)

After multiple attempts to recreate this problem without success, we're closing this issue.

One new issues was created as a result of the work in this issue. #2823541: Table clicksort is lost when using views exposed filter & Pager exposed '#items'

strykaizer’s picture

@stpaultim can you share the new issue? You seem to have linked to this issue instead

xjm’s picture

Status: Closed (cannot reproduce) » Postponed (maintainer needs more info)

@stpaultim, can you clarify how you were not able to reproduce it? We clearly reproduced it as outlined in #13, less than a week before your comment. It'd be good to post a more detailed comment explaining what you were unable to reproduce before unilaterally closing the entire issue. An exported view that reproduces it is even provided.

xjm’s picture

"Closed (cannot reproduce)" is really extreme; we should give people a chance to respond before changing to that status. #10 is reproducible. It might be a feature request to make table click sorting work with the exposed filter in a block, but until we locate that issue, we should not close this one, and if we do locate that issue, it should be closed as a duplicate.

xjm’s picture

The summary even has a proposed resolution so we definitely should not close this issue without looking into that.

xjm’s picture

Title: Sort is lost when using views exposed filter » Table clicksort is lost when using views exposed filter
Issue summary: View changes
Status: Postponed (maintainer needs more info) » Active

Yeah, #10 is definitely the bug described. Adding those STR to the summary and clarifying the title.

I don't think this is a major bug and I still think there is probably a duplicate somewhere. However, we should find such duplicates and confirm they are up to date before closing this issue. This is different from the cache invalidation bug described in the related issue. (This one is probably just a normal.)

xjm’s picture

Issue tags: +Triaged for D8 major current state
xjm’s picture

(Adding issue credit for major triage participation. Thanks!)

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.

stpaultim’s picture

Sorry, I working with a small group and we must have missed something. Personally, I understood that two other people had tried but failed to recreate the original problem.

Comment #9 "At this point, this bug is not confirmed"
Comment #12 "I'd agree that we were not able to reproduce the originally reported issue."

It was my understanding that both comment #9 and comment #12 did see a NEW issue - which was reported here: #2887144: Views exposed form block options are not updated immediately when adding additional sorts, filters, etc (Caching?) (unfortunately, I linked to the wrong issue) and must have misunderstood the connect between the two issues.

Based upon our understanding that 2 other people had failed to recreate the original issue, based upon our own failed attempts to recreate the original issue - using the steps outlined in previous comments, the fact that a new issue had been opened, and after consulting with sprint leaders - we closed the issue.

I should have been more descriptive, but it was the end of a long day and a long camp. :-( Will do better next time.

Thanks everyone for their hard work on this and all the other issues.....

j2r’s picture

This issue still exist.

Create simple node listing view with table, make all fields sortable, add 1/2 expose filter. Now sort on node title after that use expose filter, with response the sorting on node title will be reset to default.

Please let me know if you need more detail to reproduce this issue.

pwaterz’s picture

This issue is reproducible. If you setup a solr view with facets. Expose items per page. You will see that the active facets that are in the url are ignored.

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

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

samuel.mortenson’s picture

Status: Active » Needs review
StatusFileSize
new2.66 KB

I ran into something similar in #2962525: Create a field widget for the Media library module, and added some Javascript to ensure that the original query parameters are always added to the exposed filter request. The IS doesn't mention AJAX, so I'm going to try to see about a PHP fix as well.

Status: Needs review » Needs work

The last submitted patch, 31: 2823541-31.patch, failed testing. View results

samuel.mortenson’s picture

Status: Needs work » Active

Unfortunately I think the bug I was fixing in #31 was specific to AJAX and unrelated to the issue you're having. :-(

I did replicate the bug from the issue summary, but was not able to determine the best path forward to fix this problem. Since the exposed form method is GET, and a form's action cannot contain query parameters, you would need JS or PHP to add hidden input elements for every query string key. Even if you implemented this, it would not help if the view described in the IS used AJAX. I'm not sure how to address the problem in the most complete manner.

One idea I had was to add order, sort, and page as hidden input elements to the exposed form. That should fix non-AJAX forms, but for AJAX you would need to refresh the exposed form block as well when the table sort changes. This is a very tricky issue!

marcoscano’s picture

StatusFileSize
new2.69 KB
new1.09 KB

I was having some errors due to settings.view_query not being set in some circumstances, so I'm uploading a small check for that.

Maybe we could open a separate issue for the patch in #31? I do believe it solves part of the issue, for example when you want your exposed filter's AJAX calls to persist the query params.

Version: 8.6.x-dev » 8.7.x-dev

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

idebr’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 34: 2823541-34.patch, failed testing. View results

idebr’s picture

Status: Needs work » Needs review
StatusFileSize
new2.65 KB

Reroll against 8.7.x

Status: Needs review » Needs work

The last submitted patch, 38: 2823541-38.patch, failed testing. View results

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mbovan’s picture

Status: Needs work » Needs review
StatusFileSize
new2.88 KB

Reroll against 8.8.x.

By following the steps described in the issue summary and in #10 I can reproduce the problem with views that use ajax as well as with non-ajax views.

However, the patch from #31 does not fix views that have ajax enabled (as per steps from #10). To proof that we would need to write a failing test based on #12.

Additionally, I noticed that the current patch always appends _wrapper_format=drupal_ajax on next ajax requests. So the query string becomes _wrapper_format=drupal_ajax&_wrapper_format=drupal_ajax in the second ajax request, _wrapper_format=drupal_ajax&_wrapper_format=drupal_ajax&_wrapper_format=drupal_ajax in the third one and so on.

Status: Needs review » Needs work

The last submitted patch, 41: 2823541-41.patch, failed testing. View results

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new3.63 KB
new3.81 KB
+++ b/core/modules/views/views.module
@@ -59,7 +60,8 @@ function views_views_pre_render($view) {
           'view_args' => Html::escape(implode('/', $view->args)),
-          'view_path' => Html::escape(\Drupal::service('path.current')->getPath()),
+          'view_path' => Html::escape($request->getPathInfo()),
+          'view_query' => $request->getQueryString(),
           'view_base_path' => $view->getPath(),

At some point the core implementation for view_path changed and this didn't catch up with that change, the initial patch used something else.

This is a problem because on ajax requests, getPathInfo() then returns /views/ajax, while path.current is correct as views is setting that.

Same for the query arguments, the ViewAjaxController removes a bunch of them, but not from the query string, so instead of using that as-is, we have to build it again, and we also have to remove the new view_query parameter.

Also, there was a mixup with leading ?, because window.location.search did start with a ? but our setting didn't, so I changed the logic to only slice off the first character from window.location.search.

This is now passing the existing test which ensures that no extra stuff is being added as shown in #41, still need to extend tests to cover the problem this fixes.

berdir’s picture

Version: 8.9.x-dev » 9.0.x-dev
StatusFileSize
new3.43 KB

Reroll for 9.0.x, strangely on ajax_view.js conflicted, but not ajax_view.es6.js. At least now I know how to build those things, hopefully did that correctly.

xjm’s picture

Version: 9.0.x-dev » 8.8.x-dev

Since we should fix this bug in D8 too, I'm filing it against 8.8.x (which is the current bugfix support branch). Patches can be tested against other branches as needed when they're uploaded.

The issue will be automatically updated to 8.9.x after the last 8.8.x bugfix release. Thanks!

lendude’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Moving to needs work for the additional test coverage

oknate’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new19.91 KB
new23.34 KB

Adding test coverage. No interdiff is needed as this is the same as #45 except for test coverage.

The test coverage is essentially testing this assertion:

+    // Assert that sort by title is still present.
+    $assert_session->elementExists('css', '#view-title-table-column.is-active');

With the bug, when clicking filter, the sort goes away. When the bug is fixed, the sort persists.

lendude’s picture

@oknate thanks for looking at this! some nits to pick (besides the test failing :)

First: do we really need the massive new view? Isn't there something simpler in core already we can modify within the test to match our needs? (If nothing useful exists can we at least strip this down to the essentials for this test?)

  1. +++ b/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php
    @@ -93,4 +95,28 @@ public function testExposedFilteringAndReset() {
    +    $assert_session->waitForElement('css', '#view-title-table-column.is-active');
    

    waitForElement doesn't check if the element exists after waiting, so we should check for that

  2. +++ b/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php
    @@ -93,4 +95,28 @@ public function testExposedFilteringAndReset() {
    +    // The "Covid-19" node shouldn't be showing.
    

    It's not obvious why it shouldn't be showing after sorting

oknate’s picture

Status: Needs review » Needs work

1. I'll look through the existing views in core to see if there's one that allows us to do what we need, or I'll pare down the new view.
2. Really, I just need a way of testing that the view updated. Perhaps I can just check when the form id updates. I remember other tests do that. Then I wouldn't need to create new nodes, I think.
3. I don't know why the test failed, it passed locally with Drupal 9 rc1. So I'm sure it's a small thing.

oknate’s picture

Status: Needs work » Needs review
StatusFileSize
new7.68 KB
new11.14 KB

Responding to feedback in #49.
1. I reduced the size of the new view. It still may be possible to find an existing view or test view to demonstrate the issue. Also, there's probably more settings that can be removed from this view.
2. I reworked the test so it doesn't need new nodes. It can test for refresh by testing the number of items shown.
3. I don't know how I saw it working last night locally, as I'm not seeing it working this morning. As far as I see this morning, #45 doesn't fix the issue in the issue summary. I think the test I created demonstrates the bug, but with #45 applied, it still happens. The sort goes away when changing the filters, when the exposed form is in a separate block. This was testing on Drupal 9 rc1.

Next patch around this comment should be removed:
// Wait for the dialog to close.
That's a cut and paste error, and isn't relevant.

oknate’s picture

Status: Needs review » Needs work
StatusFileSize
new7.83 KB

Updated test case. I'm leaving the bug fix code out for now, as it doesn't work for this test. See #51.3.

oknate’s picture

StatusFileSize
new1.21 MB

Here's a video of the bug, as demonstrated by placing a sleep statement in the functional js test in #52.

rishabhthakur’s picture

Version: 8.8.x-dev » 8.9.x-dev
hardik_patel_12’s picture

Status: Needs work » Needs review
StatusFileSize
new7.82 KB
new371 bytes

Re-rolled for 8.9.x-dev.

Status: Needs review » Needs work

The last submitted patch, 55: 2823541-55--test-only.patch, failed testing. View results

berdir’s picture

Note: The current patch does _not_ fix the original problem described in the issue summary, it only fixes exposed filters and clicksort. Handling the block settings is fixed by #2605218: Views Block Display skips preBlockBuild() call on ajax rebuild which in turn depends on the view_query stuff introduced here.

We should possibly merge the two issues together and close one as duplicate. I would assume that the other issue will pass with the test added here. Thoughts on that?

@Primsi has been working a bit on this issue as well, but possibly without knowledge of the other one. We'll post something here soon. Don't work on it for now.

primsi’s picture

Status: Needs work » Needs review
StatusFileSize
new11.25 KB
new37.14 KB

Just quickly trying with the combination of the patch from @oknate + 9.1.x version from #2605218: Views Block Display skips preBlockBuild() call on ajax rebuild. Both are re-rolls for 9.1.x.

Status: Needs review » Needs work

The last submitted patch, 58: 2823541-58.patch, failed testing. View results

johnpitcairn’s picture

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

Shouldn't this be 9.3.x now?

johnpitcairn’s picture

For anyone trying to apply this for current Drupal core (9.2.x) - the patch at #58 applies, but does not fix the issue as described by the issue title.

For a page view that is not using ajax, click-sorting a table column header then applying an exposed filter loses the original click-sort and reverts to the default column-sort. The sort parameters are removed from the URL, with or without the patch.

For a page view that is using ajax, the patch at #58 does appear to fix the issue.

The issue summary makes no mention of ajax, and I'm not sure why that has been the focus. The title alone describes the base issue pretty well. Any fix here should also fix the issue for non-ajax views.

tim_dj’s picture

StatusFileSize
new37.14 KB
new3.37 KB

I did a reroll for 9.2.x because patch #58 no longer applies to 9.2.7 a reroll for 9.3.x is less straight forward because of the changes to modules/views/src/Plugin/views/display/Block.php

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.

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

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

megha_kundar’s picture

StatusFileSize
new37.1 KB
suresh prabhu parkala’s picture

StatusFileSize
new37.64 KB
new2.05 KB

Tried to fix custom failures of #65.

xjm’s picture

Issue tags: -Triaged for D8 major current state
berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new37.21 KB
new1.23 KB

Reroll for 9.5. Didn't figure out how to format that conditional line, converted to a regular if.

berdir’s picture

StatusFileSize
new37.17 KB
new721 bytes

Forgot to build the .js file.

Status: Needs review » Needs work

The last submitted patch, 69: 2823541-69.patch, failed testing. View results

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new36.25 KB

Reroll for D10. Did not yet look into the test fails.

Status: Needs review » Needs work

The last submitted patch, 72: 2823541-72.patch, failed testing. View results

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new37.06 KB

Rerolled the patch for D9.5, the patch for D10 is above.

Status: Needs review » Needs work

The last submitted patch, 74: 2823541-74-d9.5.patch, failed testing. View results

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new37.13 KB

Another reroll for 9.5.0-rc2.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new149 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new36.24 KB

Reroll for 10.1

Status: Needs review » Needs work

The last submitted patch, 78: 2823541-78.patch, failed testing. View results

berdir’s picture

StatusFileSize
new37.11 KB

Another D9.5 patch update.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new35.25 KB

Another reroll for 10.1

Status: Needs review » Needs work

The last submitted patch, 81: 2823541-81.patch, failed testing. View results

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

berdir’s picture

Did a reroll as a merge request for 10.2.3+, still test fails to figure out.

edmoreta’s picture

StatusFileSize
new36.39 KB

re-posting MR patch

jennypanighetti’s picture

Still not working for me, unfortunately.

New view > fields of some nodes > Table display with all columns sortable > some exposed filters

Go to page, choose a sort.
Enter a search term
->
table is re-sorted by the default sort

lovejit_singh’s picture

StatusFileSize
new36.49 KB

samit.310@gmail.com made their first commit to this issue’s fork.

samitk’s picture

HI,

I have fixed other issue reported by GitLab pipeline, but getting some errors with PHPUnit Functional Javascript and NightWatch, Post reviewing the errors, they looks like related to core.

https://git.drupalcode.org/issue/drupal-2823541/-/jobs/2599151
https://git.drupalcode.org/issue/drupal-2823541/-/jobs/2599078

Thanks
Samit K.

johnv’s picture

Title: Table clicksort is lost when using views exposed filter » Table clicksort is lost when using views exposed filter & Pager exposed '#items'
afsch’s picture

StatusFileSize
new36.5 KB

Re-rolled for D10.4

colan’s picture

Is this also supposed to fix the issue where the column click-sorting only sorts the visible rows? That is, if I have 10 in the exposed filter pager, and re-sorting should include a row on page 2, it doesn't. Patching from here doesn't seem to help.

Is this a separate issue, or was it designed to work that way (only sort the visible rows)?

berdir’s picture

Note: We've seen some issues with reset that persists on following requests and resets the filters again and again.

rsych’s picture

StatusFileSize
new25.78 KB

Re-roll for Drupal Core 11.2.4

oily’s picture

There is a failing test that looks related. Here is the output:

PHPUnit 11.5.34 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.4.12
    Configuration: /builds/issue/drupal-2823541/core/phpunit.xml.dist
    
    F                                                                   1 / 1 (100%)
    
    HTML output was generated.
    http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_demo_umami_FunctionalJavascript_OpenTelemetryNodePagePerformanceTest-1-42095066.html
    http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_demo_umami_FunctionalJavascript_OpenTelemetryNodePagePerformanceTest-2-42095066.html
    http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_demo_umami_FunctionalJavascript_OpenTelemetryNodePagePerformanceTest-3-42095066.html
    
    
    Time: 00:32.512, Memory: 10.00 MB
    
    Open Telemetry Node Page Performance (Drupal\Tests\demo_umami\FunctionalJavascript\OpenTelemetryNodePagePerformance)
     ✘ Node page
       ┐
       ├ Failed asserting that two arrays are identical.
       ┊ ---·Expected
       ┊ +++·Actual
       ┊ @@ @@
       ┊  Array &0 [
       ┊ -····'QueryCount'·=>·458,
       ┊ +····'QueryCount'·=>·460,
       ┊      'CacheSetCount' => 441,
       ┊      'CacheDeleteCount' => 0,
       ┊      'CacheTagLookupQueryCount' => 43,
       │
       │ /builds/issue/drupal-2823541/core/tests/Drupal/Tests/PerformanceTestTrait.php:689
       │ /builds/issue/drupal-2823541/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php:66
       │ /builds/issue/drupal-2823541/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php:30
       ┴
    
    FAILURES!
    Tests: 1, Assertions: 10, Failures: 1.
---- Drupal\Tests\navigation\FunctionalJavascript\PerformanceTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass         22.562s testLogin                                                                       
---- Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5AllowedTagsTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass         12.793s testEnablingToVersion5Validation                                                
Pass          6.338s testImageUploadsRemainEnabled                                                   
Pass          8.907s testSwitchToVersion5                                                            
Pass          9.138s testImgAddedViaUploadPlugin                                                     
Pass         13.026s testAllowedTags                                                                 
Pass          8.982s testMediaElementAllowedTags                                                     
Pass          9.289s testFullHtml                                                                    
---- Drupal\FunctionalJavascriptTests\Ajax\AjaxTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass          6.810s testAjaxWithAdminRoute                                                          
Pass          6.762s testDrupalSettingsCachingRegression                                             
Pass         15.181s testInsertAjaxResponse                                                          
Pass          4.007s testGlobalEvents                                                                
Pass          5.883s testUiAjaxException                                                             
Skipped       0.000s testAjaxFocus                                                                   
---- Drupal\FunctionalJavascriptTests\TableDrag\TableDragTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass          7.464s testRowWeightSwitch                                                             
Pass          5.687s testDragAndDrop                                                                 
Pass         10.631s testKeyboardAccessibility                                                       
Pass          6.831s testRootLeafDraggableRowsWithKeyboard                                           
Pass          4.128s testTableDragChangedWarning                                                     
Pass         12.087s testNestedDraggableTables                                                       
---- Drupal\Tests\workspaces\FunctionalJavascript\WorkspacesMediaLibraryIntegrationTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Skipped       0.000s testFocusNotAppliedWithoutSelectionChange                                       
Pass         28.282s testWidget                                                                      
Skipped       0.000s testRequiredMediaField                                                          
Pass         10.626s testRemoveAfterReordering                                                       
Pass         10.283s testAddAfterReordering                                                          
Skipped       0.000s testWidgetPreview                                                               
---- Drupal\Tests\system\FunctionalJavascript\Form\DevelopmentSettingsFormTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass          5.248s testTwigDevelopmentMode with data set "Twig development mode checked only"      
Pass          8.139s testTwigDevelopmentMode with data set "Twig debug mode only, keep Twig cache"   
Pass          4.100s testTwigDevelopmentMode with data set "Twig debug mode off, disable Twig cache" 
Pass          3.838s testTwigDevelopmentMode with data set "No changes"                              
Pass          4.704s testDisabledRenderedOutputCacheBins                                             
---- Drupal\FunctionalJavascriptTests\Ajax\FormValuesTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass          8.346s testSimpleAjaxFormValue with data set #0                                        
Pass          6.270s testSimpleAjaxFormValue with data set #1                                        
Pass          4.961s testSimpleAjaxFormValue with data set #2                                        
Pass          4.618s testSimpleInvalidCallbacksAjaxFormValue                                         
---- Drupal\Tests\file\FunctionalJavascript\FileFieldWidgetClaroThemeTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass         70.930s testMultiValuedWidget                                                           
Pass          4.217s testSingleValuedWidget                                                          
Pass          3.667s testUploadingMoreFilesThanAllowed                                               
Pass          5.012s testWidgetDefaultVisibilitySettings                                             
---- Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass         10.202s testAddDisplay                                                                  
Pass          6.148s testRenameDisplayAdminName                                                      
Pass          5.652s testPageContextualLinks                                                         
Pass          6.525s testAddDisplayBlockTranslation                                                  
---- Drupal\Tests\ckeditor5\FunctionalJavascript\MediaLibraryTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass         14.575s testButton                                                                      
Pass          7.612s testAllowedMediaTypes                                                           
Pass          8.920s testAlt                                                                         
---- Drupal\Tests\field_ui\FunctionalJavascript\EntityDisplayTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass         13.151s testEntityForm                                                                  
Pass          7.599s testEntityView                                                                  
Pass          8.068s testExtraFields                                                                 
---- Drupal\FunctionalJavascriptTests\Tests\JSInteractionTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass         17.281s testNotClickable                                                                
Pass         12.950s testFieldValueNotSettable                                                       
Pass          4.112s testElementsInteraction                                                         
---- Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayBlockFormTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Pass         44.969s testBlocks                                                                      
Skipped       0.000s testEditModeEnableDisable                                                       
Pass          8.931s testValidationMessages                                                          
---- Drupal\Tests\views\FunctionalJavascript\PaginationAJAXTest ----
Status      Duration Info                                                                               
--------------------------------------------------------------------------------------------------------
Fail         13.048s testBasicPagination                                                             
Fail          6.658s testDefaultFilterPagination                                                     
Fail          7.011s testPaginationAjaxWithTitleFilter                                               
Failure      27.559s *** Process execution output ***                                                
    PHPUnit 11.5.34 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.4.12
    Configuration: /builds/issue/drupal-2823541/core/phpunit.xml.dist
    
    FFF                                                                 3 / 3 (100%)
    
    HTML output was generated.
    http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_views_FunctionalJavascript_PaginationAJAXTest-1-71423746.html
    http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_views_FunctionalJavascript_PaginationAJAXTest-2-71423746.html
    http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_views_FunctionalJavascript_PaginationAJAXTest-3-73948087.html
    http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_views_FunctionalJavascript_PaginationAJAXTest-4-73948087.html
    http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_views_FunctionalJavascript_PaginationAJAXTest-5-38173237.html
    http://localhost/subdirectory/sites/simpletest/browser_output/Drupal_Tests_views_FunctionalJavascript_PaginationAJAXTest-6-38173237.html
    
    
    Time: 00:27.329, Memory: 8.00 MB
    
    Pagination AJAX (Drupal\Tests\views\FunctionalJavascript\PaginationAJAX)
     ✘ Basic pagination
       ┐
       ├ Failed asserting that two strings are equal.
       ┊ ---·Expected
       ┊ +++·Actual
       ┊ @@ @@
       ┊ -'?status=All&type=All&title=&items_per_page=5&order=changed&sort=asc&page=2'
       ┊ +'?status=All&type=All&title=&items_per_=&items_per_order=changed&sort=asc&items_per_page=5&order=changed&page=2'
       │
       │ /builds/issue/drupal-2823541/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php:116
       ┴
     ✘ Default filter pagination
       ┐
       ├ Failed asserting that two strings are equal.
       ┊ ---·Expected
       ┊ +++·Actual
       ┊ @@ @@
       ┊ -'...=default_value&items_per_page=5&order=changed&sort=asc&page=0'
       ┊ +'...=default_value&items_per_=&items_per_order=changed&sort=asc&items_per_page=5&order=changed&page=0'
       │
       │ /builds/issue/drupal-2823541/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php:200
       ┴
     ✘ Pagination ajax with title filter
       ┐
       ├ Failed asserting that '\n                                                
       ├                             No content available.          \n
       ├               ' [ASCII](length: 116) contains "Node 11 content" [ASCII](length: 15).
       │
       │ /builds/issue/drupal-2823541/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php:278
       ┴
    
    FAILURES!
    Tests: 3, Assertions: 135, Failures: 3.
---- Drupal\FunctionalJavascriptTests\Ajax\AjaxFormImageButtonTest ----

One of the assertions that is failing here is at lines 115- 116 in PaginationAJAXTest.php:

    // Test that no unwanted parameters are added to the URL.
    $this->assertEquals('?status=All&type=All&title=&items_per_page=5&order=changed&sort=asc&page=2', $link->getAttribute('href'));
oily’s picture

Here is the test-only output:

PHPUnit 11.5.34 by Sebastian Bergmann and contributors.
Runtime:       PHP 8.4.13
Configuration: /builds/issue/drupal-2823541/core/phpunit.xml.dist
DF                                                                  2 / 2 (100%)
Time: 00:13.405, Memory: 8.00 MB
There was 1 failure:
1) Drupal\Tests\views\FunctionalJavascript\BlockExposedFilterAJAXTest::testSortPersistence
Behat\Mink\Exception\ElementNotFoundException: Element matching css "#view-title-table-column.is-active" not found.
/builds/issue/drupal-2823541/vendor/behat/mink/src/WebAssert.php:465
/builds/issue/drupal-2823541/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php:131
--
2 tests triggered 1 deprecation:
1) /builds/issue/drupal-2823541/core/modules/views/src/ViewsConfigUpdater.php:295
The update to add a default table CSS class for view "block_exposed_ajax2" is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Profile, module and theme provided configuration should be updated. See https://www.drupal.org/node/3499943
Triggered by:
* Drupal\Tests\views\FunctionalJavascript\BlockExposedFilterAJAXTest::testExposedFilteringAndReset
  /builds/issue/drupal-2823541/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php:65
* Drupal\Tests\views\FunctionalJavascript\BlockExposedFilterAJAXTest::testSortPersistence
  /builds/issue/drupal-2823541/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php:112
FAILURES!
Tests: 2, Assertions: 25, Failures: 1, Deprecations: 1.
HTML output directory sites/simpletest/browser_output is not a writable directory.
PHPUnit 11.5.34 by Sebastian Bergmann and contributors.
Runtime:       PHP 8.4.13
Configuration: /builds/issue/drupal-2823541/core/phpunit.xml.dist
F                                                                   1 / 1 (100%)
Time: 00:04.949, Memory: 8.00 MB
There was 1 failure:
1) Drupal\Tests\views\FunctionalJavascript\BlockOverridesAJAXTest::testBlockOverridesAjax
Failed asserting that actual size 10 matches expected size 5.
/builds/issue/drupal-2823541/core/modules/views/tests/src/FunctionalJavascript/BlockOverridesAJAXTest.php:92
FAILURES!
Tests: 1, Assertions: 10, Failures: 1, PHPUnit Deprecations: 2.
oily’s picture

It seems that the update in core/modules/views/tests/fixtures/update/views.view.test_table_css_class.yml is triggering the deprecation at lines 293 to 296 of core/modules/views/src/ViewsConfigUpdater.php.

@berdir Should/ can views.view.test_table_css_class.yml and core/modules/views/tests/fixtures/update/test_table_css_class.php be removed? Should that be done in a follow up?

rsych’s picture

StatusFileSize
new28.66 KB

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.