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

Comments

Sharique created an issue. See original summary.

sharique’s picture

StatusFileSize
new1.42 KB

Here is patch to fix above deprecations.

sharique’s picture

Status: Active » Needs review
sharique’s picture

StatusFileSize
new1.83 KB
new615 bytes

Updated patch to fix test.

amitgoyal’s picture

Status: Needs review » Reviewed & tested by the community
Parent issue: » #3071865: [META] Prepare Lightning for Drupal 9

#4 looks good to me.

➜  d9 git:(8.8.x) ✗ ./vendor/mglaman/drupal-check/drupal-check --drupal-root=./ modules/contrib/views_infinite_scroll

 5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


 [OK] No errors
maximpodorov’s picture

global $pager_page_array, $pager_total are deprecated and should be replaced by PageManager service methods.

naveenvalecha’s picture

Title: Prerare views_infinite_scroll module for Drupal 9 » Prepare views_infinite_scroll module for Drupal 9

Fixing the typo in title.

ankush_03’s picture

StatusFileSize
new1.46 KB

Adding doc comment for variable.

/**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'classy';
ankush_03’s picture

StatusFileSize
new1.46 KB
ankush_03’s picture

StatusFileSize
new1.87 KB
maximpodorov’s picture

global $pager_page_array, $pager_total are deprecated and should be replaced by PageManager service methods.

berdir’s picture

Status: Reviewed & tested by the community » Needs work

Yes, needs work for that.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new2.24 KB

Haven't yet addressed #11, but this merges in the changes from #3116546: Declare Drupal 9 compatibility, as suggested by @Berdir in that issue.

katherined’s picture

StatusFileSize
new3.82 KB
new2.54 KB

Converted the simpletest, and I think this addresses #11.

berdir’s picture

+++ b/views_infinite_scroll.info.yml
@@ -3,6 +3,7 @@ type: module
 package: Views
 core: 8.x
+core_version_requirement: ^8 || ^9
 

the 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.

andypost’s picture

Status: Needs review » Needs work
+++ b/views_infinite_scroll.info.yml
@@ -3,6 +3,7 @@ type: module
 core: 8.x
+core_version_requirement: ^8 || ^9

core part should be removed and pager require core_version_requirement: ^8.8 || ^9

andreyjan’s picture

Status: Needs work » Needs review
StatusFileSize
new3.85 KB
new446 bytes

Fixed core_version_requirement key.

katherined’s picture

StatusFileSize
new4.97 KB
new1.79 KB

I 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.

phenaproxima’s picture

StatusFileSize
new4.81 KB
new4.83 KB

I 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. :)

phenaproxima’s picture

StatusFileSize
new4.58 KB
new4.6 KB

Whoops, I screwed up with git and botched that patch. Here is the correct pair.

The last submitted patch, 19: 3097542-19-FAIL.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

The last submitted patch, 20: 3097542-20-FAIL.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • Sam152 committed 8448738 on 8.x-1.x authored by katherined
    Issue #3097542 by phenaproxima, ankushgautam76@gmail.com, katherined,...
sam152’s picture

Status: Needs review » Fixed

Done, thanks!

Status: Fixed » Closed (fixed)

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

omnia.ibrahim’s picture

there 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)

omnia.ibrahim’s picture

StatusFileSize
new1.54 KB

Attached 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)

omnia.ibrahim’s picture

omnia.ibrahim’s picture

StatusFileSize
new1.5 KB

Attached 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)

berdir’s picture

I suggest you create a new issue for that, might get lost here and only maintainers could reopen it. Then reference it here.