Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow up to #2044435: Convert pager.inc to a service
+++ b/core/lib/Drupal/Core/Pager/PagerManagerInterface.php
@@ -0,0 +1,153 @@
+ * $where = "status = 1";
+ * $total = mymodule_select("SELECT COUNT(*) FROM data " . $where)->result();
+ * $num_per_page = \Drupal::config('mymodule.settings')->get('num_per_page');
@catch:
I'm sure this is copy/pasted but there's no need for $where to be a variable here. Would be good to update the docs to use selectquery or similar (in a follow-up, appreciate this is probably copy and paste from the old example).
Comment | File | Size | Author |
---|---|---|---|
#4 | 3087486-4.patch | 896 bytes | AkashKumar07 |
Comments
Comment #2
kim.pepperComment #3
kim.pepperComment #4
AkashKumar07 CreditAttribution: AkashKumar07 at OpenSense Labs commentedComment #5
naresh_bavaskarComment #6
naresh_bavaskarThe above patch fine for me.
Comment #7
naresh_bavaskarComment #8
naresh_bavaskarComment #9
kim.pepper+1 rtbc
Comment #11
Krzysztof DomańskiRandom test failure #3103492: Random fail in WidgetUploadTest.
Comment #12
Gayathri J CreditAttribution: Gayathri J at UniMity Solutions Pvt Limited commentedHi team #4 patch is fine for me we can add WHERE condition directly looking good.
Comment #14
alexpottCrediting @catch as it was a comment from @catch that led to this patch. Crediting @kim.pepper for creating the issue and reviewing it.
Backported to 8.8.x as a docs fix.
Committed and pushed fb4c658da8 to 9.0.x and 54ee2173f2 to 8.9.x and 0bd9bf2d37 to 8.8.x. Thanks!