Closed (fixed)
Project:
Facets
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2017 at 15:27 UTC
Updated:
24 Jun 2019 at 05:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
recrit commentedThe attached patch removes the page parameter from the facet links.
Comment #3
recrit commentedComment #4
borisson_Should've been fixed a year ago with: #2704669: Remove page parameter from urls.
So we should write a new test to actually prove this behavior so we can't run into regressions again.
Comment #5
borisson_This adds a test. Test only should fail.
Comment #7
borisson_Either the test is insufficient or the code added here wasn't needed.
Comment #8
borisson_Actually, the test here proves that the code was not needed. In what scenario does this still happen? The scenario you describe is being tested in the new test and that works without your code. ($result_get_params is already a clone of $get_params and that shouldn't have a 'page' anymore)
In the same method, we already do this:
Test is still valuable though.
Comment #9
recrit commentedI am seeing the issue occur starting with the 2nd link in the facet block. The first link is correct with no "page" parameter. See the debugging image attached.
I attached a new test that checks both content types in the facet block. The thinking that the second link in the block should fail. My local simpletest environment is having issues so posting for d.o to run.
Comment #10
recrit commentedComment #12
recrit commentedConfirmed: failed on for
$this->assertFalse(strpos($this->getUrl(), 'page=1'));on /var/www/html/modules/contrib/facets/tests/src/Functional/UrlIntegrationTest.php:203Comment #13
recrit commentedOriginal patch with the #9 tests.
There could be a cleaner way to do this but this is a fail safe when creating the url for the link.
It appears that some code in the loop resets
$this->request->query. I suspect that it is the recursion of the children call even though I am not using a hierarchical facet:After this buildUrls() call in the loop it would set the
$this->request->query's page back with the code at the end of the method:Comment #14
borisson_Ok, this doesn't look very clean, but the test confirms that it works. So I'm going to believe the test. Thanks!
Comment #15
borisson_Committed and pushed, thanks!
Comment #18
chuchunaku commentedJust an FYI. The patch for #13 removes the page parameter from the facet links but the patch for https://www.drupal.org/project/facets/issues/2726455 restores the page parameter back. As a result, the issue described in this ticket has re-appeared.
Both patches were merged and appear to compete with each other. https://cgit.drupalcode.org/facets/tree/src/Plugin/facets/url_processor/...
Comment #19
replicaobscuraI'm getting the page parameter in my facet URLs again. Has this been re-addressed since ChuChuNaKu's comment a year ago?
Comment #20
borisson_I don't think so, no. Could you open a new issue?