I ran drupal-check in the latest code base and found 3 issues.
➜ views_infinite_scroll git:(8.x-1.x) drupal-check .
5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ -----------------------------------------------------------------------------------------------------------------------
Line src/Tests/IntegrationSmokeTest.php
------ -----------------------------------------------------------------------------------------------------------------------
12 Class Drupal\views_infinite_scroll\Tests\IntegrationSmokeTest extends deprecated class Drupal\simpletest\WebTestBase:
in drupal:8.8.0 and is removed from drupal:9.0.0. Instead,
use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340.
25 Call to method setUp() of deprecated class Drupal\simpletest\WebTestBase:
in drupal:8.8.0 and is removed from drupal:9.0.0. Instead,
use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340.
------ -----------------------------------------------------------------------------------------------------------------------
------ ---------------------------------------------------------------------------
Line views_infinite_scroll.module
------ ---------------------------------------------------------------------------
23 Call to deprecated function pager_query_add_page():
in drupal:8.8.0 and is removed from drupal:9.0.0. Use
\Drupal\Core\Pager\PagerManagerInterface::getUpdatedParameters() instead.
------ ---------------------------------------------------------------------------
[ERROR] Found 3 errors
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | views_infinite_scroll_drupal9.patch | 1.5 KB | omnia.ibrahim |
| #20 | 3097542-20-PASS.patch | 4.6 KB | phenaproxima |
| #20 | 3097542-20-FAIL.patch | 4.58 KB | phenaproxima |
| #19 | 3097542-19-PASS.patch | 4.83 KB | phenaproxima |
| #19 | 3097542-19-FAIL.patch | 4.81 KB | phenaproxima |
Comments
Comment #2
sharique commentedHere is patch to fix above deprecations.
Comment #3
sharique commentedComment #4
sharique commentedUpdated patch to fix test.
Comment #5
amitgoyal commented#4 looks good to me.
Comment #6
maximpodorov commentedglobal $pager_page_array, $pager_total are deprecated and should be replaced by PageManager service methods.
Comment #7
naveenvalechaFixing the typo in title.
Comment #8
ankush_03Adding doc comment for variable.
Comment #9
ankush_03Comment #10
ankush_03Comment #11
maximpodorov commentedglobal $pager_page_array, $pager_total are deprecated and should be replaced by PageManager service methods.
Comment #12
berdirYes, needs work for that.
Comment #13
phenaproximaHaven't yet addressed #11, but this merges in the changes from #3116546: Declare Drupal 9 compatibility, as suggested by @Berdir in that issue.
Comment #14
katherinedConverted the simpletest, and I think this addresses #11.
Comment #15
berdirthe pager deprecation changes means this needs ^8.8 || ^9 and with that, removal of the core: 8.x key.
As mentioned on slack, I didn't check if the pager updates are correct, but the fact that the tests pass on 8.8 is already a good indicator, still, a manual test against D9 would be great as extra proof.
Comment #16
andypostcore part should be removed and pager require
core_version_requirement: ^8.8 || ^9Comment #17
andreyjan commentedFixed core_version_requirement key.
Comment #18
katherinedI tested this manually on D9, and found that it actually errors in D8.8 and D9 if items per page is set to zero, even though it still allows the D8.8 test to pass. Attempting to address that here.
Comment #19
phenaproximaI paired with @katherined on this. The patch in #18 is very close to what it needs to be -- I just wanted to understand some of the pager logic happening in the preprocess function, and the nature of the additional test coverage. Now that I do (thanks @katherined!) I removed a few extraneous changes in IntegrationSmokeTest, expanded the comment over the new coverage in InfiniteScrollTest, and slightly cleaned up the changes to the preprocess function, with a FAIL patch to prove that the
isset($pager)check in the preprocess function is actually effectively covered by InfiniteScrollTest. So really, just minor stuff! This is a good patch, it should be committed. :)Comment #20
phenaproximaWhoops, I screwed up with git and botched that patch. Here is the correct pair.
Comment #24
sam152 commentedDone, thanks!
Comment #26
omnia.ibrahim commentedthere is still an error "pager_query_add_page()"
Error: Call to undefined function pager_query_add_page() in views_infinite_scroll_preprocess_views_view() (line 55 of /var/www/html/docroot/modules/contrib/views_infinite_scroll/views_infinite_scroll.module)
Comment #27
omnia.ibrahim commentedAttached is the patch to solve
Error: Call to undefined function pager_query_add_page() in views_infinite_scroll_preprocess_views_view() (line 55 of /var/www/html/docroot/modules/contrib/views_infinite_scroll/views_infinite_scroll.module)
Comment #28
omnia.ibrahim commentedComment #29
omnia.ibrahim commentedAttached is the patch to solve
Error: Call to undefined function pager_query_add_page() in views_infinite_scroll_preprocess_views_view() (line 55 of /var/www/html/docroot/modules/contrib/views_infinite_scroll/views_infinite_scroll.module)
Comment #30
berdirI suggest you create a new issue for that, might get lost here and only maintainers could reopen it. Then reference it here.