Commit 0788a782 authored by alexpott's avatar alexpott

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

(cherry picked from commit 273bf8e1)
parent 5d5ff8dc
......@@ -335,13 +335,13 @@ function template_preprocess_pager(&$variables) {
* The altered $query parameter array.
*
* @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 \Drupal\Core\Pager\PagerManagerInterface::getUpdatedParameters()
*/
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 */
$pager_manager = \Drupal::service('pager.manager');
return $pager_manager->getUpdatedParameters($query, $element, $index);
......
......@@ -69,11 +69,11 @@ public function getInfo() {
public static function preRenderPager(array $pager) {
// Note: the default pager theme process function
// template_preprocess_pager() also calls
// \Drupal\Core\Pager\PagerManagerInterface::queryAddPage(), which maintains
// the existing query string. Therefore template_preprocess_pager() adds the
// 'url.query_args' cache context, which causes the more specific cache
// context below to be optimized away. In other themes, however, that may
// not be the case.
// \Drupal\Core\Pager\PagerManagerInterface::getUpdatedParameters(), which
// maintains the existing query string. Therefore
// template_preprocess_pager() adds the 'url.query_args' cache context,
// which causes the more specific cache context below to be optimized away.
// In other themes, however, that may not be the case.
$pager['#cache']['contexts'][] = 'url.query_args.pagers:' . $pager['#element'];
return $pager;
}
......
......@@ -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() {
$this->assertArrayHasKey('page', pager_query_add_page([], 1, 1));
......
......@@ -38,7 +38,7 @@ public function testDefaultInitializeGlobals() {
/**
* @covers ::getUpdatedParameters
*/
public function testQueryAddPage() {
public function testGetUpdatedParameters() {
$element = 2;
$index = 5;
$test_parameters = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment