Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Views pager should be built with view::get_exposed_input(), not $view->exposed_raw_input. #6843

Open
anemirovsky opened this issue Feb 4, 2025 · 6 comments · May be fixed by backdrop/backdrop#5008

Comments

@anemirovsky
Copy link

anemirovsky commented Feb 4, 2025

This is documented in #3723 under 2f23c3e0 | Issue #2315365 by alexdmccabe: Pager should be built with view::get_exposed_input(), not $view->exposed_raw_input..

We hit a bug where the pager links were incorrectly including & symbols for Views exposed filters that were empty, so the URL would look like https://example.org/search?type=country&&&&&&page=1 rather than https://example.org/search?type=country&page=1 and the View output would break because of it.

PR incoming!

Steps to reproduce:

  1. Edit the default admin content View (/admin/structure/views/view/node_admin_content/configure/page)
  2. Edit the existing "Content: Type" exposed filter.
  3. Set "Filter type to expose" to "Grouped filters".
  4. Check "Allow multiple selections".
  5. In the grouped filters configuration section, set the first option Label to "Page or Post" (though it can be anything) and check "Page" and "Post" for the Value.
  6. Remove any remaining grouped filter options and save the filter.
  7. Change the pager to show 1 item at a time.
  8. Save the View.
  9. Ensure you have at least a few nodes created.
  10. Go to /admin/content/node and click "2" on the pager.
  11. You should get an error like "Invalid option 0 in type element." After the patch, no error should appear and the pager should work.
@indigoxela
Copy link
Member

Hi @anemirovsky, many thanks for reporting and your PR. I almost missed it, because it doesn't link to this issue (as recommended).

Suggestion: instead of plain Fixes #6843, you'd have to actually use the full URL, as the code and pr are in different GH repos. 😉 Without the full URL the reference doesn't work.

In the meantime I'll try to find someone who can approve your PR, so the functional tests run.

@indigoxela
Copy link
Member

Oh, and BTW, our issue template contains suggestions for a helpful issue description, which contains crucial info like steps to reproduce and environment info like Backdrop CMS and PHP version. Your current description's a bit... short. 😉

@argiepiano
Copy link

@anemirovsky thanks so much for providing the PR. Can you please edit the OP and include steps to reproduce the error? It's difficult to test PRs without that. As mentioned by @indigoxela above, the descriptions need to be rich in details.

@herbdool herbdool added this to the 1.30.1 milestone Feb 7, 2025
@herbdool
Copy link

herbdool commented Feb 7, 2025

Since it matches the Drupal patch exactly and it's been in Drupal for quite some time, it's probably just fine here. Once we get some testing, let's merge.

@anemirovsky
Copy link
Author

Apologies, I've updated the OP with steps to reproduce. I'd assumed since this was an issue that was fixed in D7 Views that the original issue report and patch would be sufficient but I'll be sure to add details going forward for these kinds of things.

@argiepiano
Copy link

Confirming this fixes this issue. RTBC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants