Skip to content
Snippets Groups Projects
Unverified Commit 273bf8e1 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3087518 by kim.pepper: Remove references to queryAddPage() in comments...

Issue #3087518 by kim.pepper: Remove references to queryAddPage() in comments and deprecation notices
parent fd49b9e7
No related branches found
No related tags found
6 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!144Issue #2666286: Clean up menu_ui to conform to Drupal coding standards
...@@ -335,13 +335,13 @@ function template_preprocess_pager(&$variables) { ...@@ -335,13 +335,13 @@ function template_preprocess_pager(&$variables) {
* The altered $query parameter array. * The altered $query parameter array.
* *
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use * @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Pager\PagerManagerInterface->queryAddPage() instead. * \Drupal\Core\Pager\PagerManagerInterface::getUpdatedParameters() instead.
* *
* @see https://www.drupal.org/node/2779457 * @see https://www.drupal.org/node/2779457
* @see \Drupal\Core\Pager\PagerManagerInterface::getUpdatedParameters() * @see \Drupal\Core\Pager\PagerManagerInterface::getUpdatedParameters()
*/ */
function pager_query_add_page(array $query, $element, $index) { function pager_query_add_page(array $query, $element, $index) {
@trigger_error(__FUNCTION__ . ' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Pager\PagerManagerInterface->queryAddPage() instead. See https://www.drupal.org/node/2779457', E_USER_DEPRECATED); @trigger_error(__FUNCTION__ . ' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Pager\PagerManagerInterface->getUpdatedParameters() instead. See https://www.drupal.org/node/2779457', E_USER_DEPRECATED);
/* @var $pager_manager \Drupal\Core\Pager\PagerManagerInterface */ /* @var $pager_manager \Drupal\Core\Pager\PagerManagerInterface */
$pager_manager = \Drupal::service('pager.manager'); $pager_manager = \Drupal::service('pager.manager');
return $pager_manager->getUpdatedParameters($query, $element, $index); return $pager_manager->getUpdatedParameters($query, $element, $index);
......
...@@ -69,11 +69,11 @@ public function getInfo() { ...@@ -69,11 +69,11 @@ public function getInfo() {
public static function preRenderPager(array $pager) { public static function preRenderPager(array $pager) {
// Note: the default pager theme process function // Note: the default pager theme process function
// template_preprocess_pager() also calls // template_preprocess_pager() also calls
// \Drupal\Core\Pager\PagerManagerInterface::queryAddPage(), which maintains // \Drupal\Core\Pager\PagerManagerInterface::getUpdatedParameters(), which
// the existing query string. Therefore template_preprocess_pager() adds the // maintains the existing query string. Therefore
// 'url.query_args' cache context, which causes the more specific cache // template_preprocess_pager() adds the 'url.query_args' cache context,
// context below to be optimized away. In other themes, however, that may // which causes the more specific cache context below to be optimized away.
// not be the case. // In other themes, however, that may not be the case.
$pager['#cache']['contexts'][] = 'url.query_args.pagers:' . $pager['#element']; $pager['#cache']['contexts'][] = 'url.query_args.pagers:' . $pager['#element'];
return $pager; return $pager;
} }
......
...@@ -34,7 +34,7 @@ public function testGetQueryParameters() { ...@@ -34,7 +34,7 @@ public function testGetQueryParameters() {
} }
/** /**
* @expectedDeprecation pager_query_add_page is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Pager\PagerManagerInterface->queryAddPage() instead. See https://www.drupal.org/node/2779457 * @expectedDeprecation pager_query_add_page is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Pager\PagerManagerInterface->getUpdatedParameters() instead. See https://www.drupal.org/node/2779457
*/ */
public function testQueryAddPage() { public function testQueryAddPage() {
$this->assertArrayHasKey('page', pager_query_add_page([], 1, 1)); $this->assertArrayHasKey('page', pager_query_add_page([], 1, 1));
......
...@@ -38,7 +38,7 @@ public function testDefaultInitializeGlobals() { ...@@ -38,7 +38,7 @@ public function testDefaultInitializeGlobals() {
/** /**
* @covers ::getUpdatedParameters * @covers ::getUpdatedParameters
*/ */
public function testQueryAddPage() { public function testGetUpdatedParameters() {
$element = 2; $element = 2;
$index = 5; $index = 5;
$test_parameters = [ $test_parameters = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment