Steps to reproduce

- Add views_exposed_form to the field in /admin/config/user-interface/antibot
- Open a view with pager and exposed filters
- Click on a link in the pager
- You see an error message "Submission failed. Please reload the page, ensure JavaScript is enabled and try again.". I think this is caused by the empty value parameter "antibot_key=" which is added to the pager's links.

This is not the case when ajax is activated for the views.

Is this an issue for views or for this module?!

Comments

tobiberlin created an issue. See original summary.

tobiberlin’s picture

Title: When activated with views_exposed_form vies pager not working anymore » When activated with views_exposed_form views pager not working anymore
tobiberlin’s picture

When I enter the page view with query parameters and delete the antibot parameter from the query string everything is working. When I start a search on the view page by submitting the exposed filter form the antibot parameter is added correctly to the resulting url and everything is working.

I wonder if it is really the right way to add the antibot key parameter as a query string to an URL?! Maybe it would be the right way to alter the pager output to avoid that the antibot parameter is added to the links? But then the antibot validation would never work for GET forms.

If it is correct to add the antibot query parameter to the URL the question is why the pager gets an empty value for the antibot input. I think the probem might be that the form gets an empty hidden input for the antibot key and views does not know how to get the real antibot key. I did not find out yet where exactly the ViewExecutable get the values for the exposed input (raw) but as these exposed input values are sent to the pager in ViewExecutable->renderPager() I am quite sure that this is source of the problem.

arnaud-brugnon’s picture

Hello,

I got the same issue.
I can't add ajax support because i have stupid facets on it.

The issue is because antibot_key is not set in pagers link with JS.

I will try to write a patch for it.

arnaud-brugnon’s picture

Status: Active » Needs review
StatusFileSize
new926 bytes

I think that pagers link show not be covered by antibot module.

I write a patch in this sense

paulocs’s picture

StatusFileSize
new916 bytes

Patch #6 makes sense.
I'm adding a new patch that fixes code standards issues.

hmendes’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new6.87 KB

I tested the patch from #6 and it worked for me. Changing this to RTBC.

Steps:

  • Enable the module
  • Go to /admin/config/user-interface/antibot
  • Add 'views_exposed_form' to the Form IDs textarea
  • Go to /admin/content ( I added a few contents with Devel )
  • Click on the pager to go to the second page

Before Patch:
Shows the error

After patch: no error, the pager works

gaurav.kapoor’s picture

Thanks for working on this, I have modified hook views pre-render function doc comment to make it more clear.

  • gaurav.kapoor committed a4af066 on 8.x-1.x authored by paulocs
    Issue #3200060 by arnaud-brugnon, paulocs, hmendes, tobiberlin, gaurav....
gaurav.kapoor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.