Comments

kim.pepper created an issue. See original summary.

kim.pepper’s picture

Issue tags: +Novice
mradcliffe’s picture

Adding tags for contribution day at amsterdam2019.

We should briefly clarify the proposed resolution.

mdupont’s picture

Status: Active » Needs review
StatusFileSize
new23.66 KB

Proposed patch to remove BC layer for pager:

  • removes usage of globals and deprecated pager.inc functions
  • removes deprecation messages and tests wherever possible, including in constructors which now requires pager services

To be determined:

  • How to handle Drupal\taxonomy\Form\OverviewTerms::__construct() parameters order if we make the pager manager required

Status: Needs review » Needs work

The last submitted patch, 4: remove_pager_bc-3087517-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mdupont’s picture

Status: Needs work » Needs review
StatusFileSize
new36.22 KB
new13.23 KB

Updated version of the patch, also removes pager.inc

mdupont’s picture

StatusFileSize
new36.39 KB
new2.52 KB

Minor styling fix:
- Drupal\Core\Cache\Context\PagersCacheContext doesn't need to use PagerManagerInterface
- fix error that was already in Core code, where Drupal\views\Plugin\views\pager\SqlBase uses PagerParameters directly instead of PagerParametersInterface
- Improved reference to class function in code comment

kim.pepper’s picture

StatusFileSize
new37.15 KB

Thanks mdupont! All looks good to me.

I had issues trying to apply the patch removing pager.inc though. I've re-rolled it here.

Status: Needs review » Needs work

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

mdupont’s picture

Status: Needs work » Needs review
StatusFileSize
new37.12 KB
new612 bytes

Thanks @kim.pepper! Your re-rerolled patch worked against the HEAD of the 9.x branch, however in the meantime theme_preprocess_pager() was updated in #3094536: PHP 7.1 Warning: A non-numeric value encountered in template_preprocess_pager(). Re-rerolled with the fix.

mdupont’s picture

StatusFileSize
new37.47 KB
new667 bytes

I removed the DeprecatedArray mentions as well in this one (as PHP CodeSniffer reminded me :-)

longwave’s picture

StatusFileSize
new37.97 KB
new807 bytes

I think we should also remove the deprecated requestStack property here?

mdupont’s picture

Status: Needs review » Reviewed & tested by the community

Indeed, looking at #2044435: Convert pager.inc to a service and the current 9.0.x HEAD, it should be removed as PagersCacheContext does not extend RequestStackCacheContextBase anymore.

I went through the changes again and found no issue, I think this is good to go!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed
+++ b/core/lib/Drupal/Core/Pager/PagerManager.php
@@ -103,30 +102,6 @@ protected function getMaxPagerElementId() {
-  /**
-   * Updates global variables with a pager data for backwards compatibility.
-   */
-  protected function updateGlobals() {

In future we should use private scope for BC layers because if we really enforced API rules this is an API break.

alexpott’s picture

Committed 8486c38 and pushed to 9.0.x. Thanks!

  • alexpott committed 8486c38 on 9.0.x
    Issue #3087517 by mdupont, longwave, kim.pepper: Remove BC layer for...

Status: Fixed » Closed (fixed)

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