- Merge request !1484Exposed filters get values from URL when Ajax is on โ (Closed) created by claudiu.cristea
- last update
almost 2 years ago 29,201 pass, 26 fail - last update
almost 2 years ago Patch Failed to Apply - Status changed to Needs review
almost 2 years ago 4:48pm 22 June 2023 - last update
almost 2 years ago Patch Failed to Apply - ๐บ๐ธUnited States AaronBauman Philadelphia
None of these patches work against drupal ^10.1 or ^11
Here's a re-roll
- last update
almost 2 years ago 29,531 pass - last update
almost 2 years ago Patch Failed to Apply - last update
almost 2 years ago 29,436 pass - Status changed to Needs work
almost 2 years ago 12:45am 23 June 2023 - ๐บ๐ธUnited States smustgrave
Was previously tagged for tests which still appear to be needed.
And issue summary could use some attention.
Thanks
- First commit to issue fork.
- ๐ซ๐ทFrance prudloff Lille
This patch seems to break โจ Enable bookmarking of AJAX views Needs work when both are applied.
- ๐บ๐ธUnited States AaronBauman Philadelphia
AaronBauman โ changed the visibility of the branch 3121172-exposed-filters-url to hidden.
- ๐บ๐ธUnited States AaronBauman Philadelphia
Re-rolled against 11.x and 10.2.x
Still working for me, still needs tests
hiding MR 1484 to minimize noise, but please unhide if someone wants to untangle it.
- last update
about 1 year ago Patch Failed to Apply - ๐ช๐ธSpain akalam
Patch on #28 didn't work for me using facets v3.
I'm uploading a new patch using a simpler solution, skip url querystring on the settings object being passed to the ajax method on javascript. By this way, all the input from the form is being sent, but the querystring is not, so no override on parameters is raising the server.
- ๐ง๐ทBrazil joaopauloc.dev
patch #29 worked for me, Drupal 10.2.6m thanks!
- ๐ช๐ธSpain unstatu
I have improved the approach taken by #29 in order to only remove the inputs existing in the exposed form from the URL used by AJAX.
I did this because I found a problem using the media library with this patch applied. The steps to reproduce the problem are the following :
- Open the media library modal of a field widget
- Use the exposed form in the media library modal and send the form to filter the results
- Select any media and click insert
- You will get the following error: "The opener ID parameter is required and must be a string."This happens because the patch in #29 is removing the query parameters required by the media library (in addition to the ones present in the exposed form) when the AJAX call is done.
- ๐ช๐ธSpain unstatu
I messed up with the paths.
This version has the same code but with the correct paths.
- ๐ช๐ธSpain akalam
Patch #32 is using "this" instead of "that" in a context where this is the windows object. Here's a patch fixing it
- ๐ง๐พBelarus gun_dose
Patch #33 has some issues for me. It operates with form values, so if I have some value in URL, uncheck it, apply filters and then check other value, both values appears checked, because form data doesn't contain value key if all options are unchecked. Also in my case I have multiple values for my filter, so in URL it appears as manufacturer[0], manufacturer[1] etc. And in form adata it appearc as manufacturer[] (with empty brakes). To handle this I splitted filter names by openig square brake and now it works for me.
- ๐ท๐ดRomania andreic
The only patch version that work for me in 10.2.6 was the one in #34. However, it fixes only the tag filtering, those are respected now but the problem is results are no longer returned.
- ๐จ๐ฆCanada gordonio
I ran into the same issue as #31 with the opener_id error. The patch in #34 seems to be working fine for me and I haven't noticed any issues with filtering so far.
Core Version 10.2.6
- ๐ซ๐ทFrance prudloff Lille
prudloff โ changed the visibility of the branch 10.0.x to hidden.
- ๐ซ๐ทFrance prudloff Lille
prudloff โ changed the visibility of the branch 11.x to hidden.
- First commit to issue fork.
- ๐ฌ๐งUnited Kingdom oily Greater London
Tried to fix Javascript lint. Search and replaced $exposed_form with camelcase $exposedForm. Reduced lint errors from 20 to 18.
- ๐ฎ๐ณIndia niranjan_panem Gurugram
Tested it in drupal 11 with below description.
1. created a view
2. created the filter of authored on field and exposed it
3. tested the filter field with before adding ajax to exposed form.
4. tested the filter field with after adding ajax to exposed form.Before adding ajax, filter parameters are taken from url and giving expected output.
After adding ajax, filter parameters which still exist in url are not taken to get results.It is working as expected.
Below is the screen shot of before adding ajax.
Below is the screen shot of after adding ajax.
- ๐ซ๐ทFrance prudloff Lille
This will get more visible if โจ Enable bookmarking of AJAX views Needs work is merged, because then a lot more AJAX requests will be made with existing GET parameters in the URL.
I will try to find a way to show this in a test. - ๐ซ๐ทFrance prudloff Lille
I tried reverting the camel case changes locally but it makes
yarn run lint:core-js-passing
complain:/media/pierre/Projets/workspace/drupal-core/core/modules/views/js/ajax_view.js 176:20 error Identifier '$exposed_form' is not in camel case camelcase 182:5 error Insert `ยทยท` prettier/prettier 182:5 error Identifier '$exposed_form' is not in camel case camelcase
- ๐บ๐ธUnited States smustgrave
Hiding patches and closing old MRs
Following the steps I get a request like
https://drupal-11x.ddev.site/views/ajax?status=All&title=&type=All&_wrapper_format=drupal_ajax&title=&type=All&status=All&view_name=content&view_display_id=page_1&view_args=&view_path=%2Fadmin%2Fcontent&view_base_path=admin%2Fcontent&view_dom_id=163f73bb84d4e170f0b939de25d6c337ec0daf0d5e472897f73c099a6e1eb94f&pager_element=0&_drupal_ajax=1&ajax_page_state%5Btheme%5D=claro&ajax_page_state%5Btheme_token%5D=U8_NBi2POrE9U1ELs8h7ziadng1Svy8k__iIvXtLat0&ajax_page_state%5Blibraries%5D=eJx9j20OwjAIhi_UbWfwJIZ2ZKuy0gCdH6e36hqjS_zTwMMDeevjdMwx4-C3wgUC4WGUkoH6BGtn4HWjE7EH6tRuFNPkAifDqxWg5n9IV42z_leMmTxIlQTbGILFFV_bX7ymIJwRRpQ9F9TMSevifqZIGOzNE8sCFO_odGaxUKyprXdbpqFl--l71AAZD-MSkyuK0g486z7Wz6lbI150eL09nOD6BRYeC-EDDheR7w
After applying the MR
I get
https://drupal-11x.ddev.site/views/ajax?_wrapper_format=drupal_ajax&title=&type=All&status=All&view_name=content&view_display_id=page_1&view_args=&view_path=%2Fadmin%2Fcontent&view_base_path=admin%2Fcontent&view_dom_id=6bd75558a30df1be7b7f74ebc9fc473a68a2dc3c5e496a831679f7aed2d7155a&pager_element=0&_drupal_ajax=1&ajax_page_state%5Btheme%5D=claro&ajax_page_state%5Btheme_token%5D=U8_NBi2POrE9U1ELs8h7ziadng1Svy8k__iIvXtLat0&ajax_page_state%5Blibraries%5D=eJx9j20OwjAIhi_UbWfwJIZ2ZKuy0gCdH6e36hqjS_zTwMMDeevjdMwx4-C3wgUC4WGUkoH6BGtn4HWjE7EH6tRuFNPkAifDqxWg5n9IV42z_leMmTxIlQTbGILFFV_bX7ymIJwRRpQ9F9TMSevifqZIGOzNE8sCFO_odGaxUKyprXdbpqFl--l71AAZD-MSkyuK0g486z7Wz6lbI150eL09nOD6BRYeC-EDDheR7w
Not the best with nightwatch review and test-only pipeline doesn't work with nightwatch But
browser.assert.strictEqual( url.searchParams.getAll('title').length, 1, 'Duplicate title parameter', );
Should show the duplicates so believe it's valid coverage
Going to mark.