Problem/Motivation

An error occurs with PHP 8:

Deprecated: Required parameter $entity follows optional parameter $pager_type in modules/contrib/stacks/src/TwigExtension/Pagination.php on line 32

Issue fork stacks-3318200

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mahseri created an issue. See original summary.

avpaderno’s picture

Title: PHP Deprecated: Required parameter $entity follows optional parameter $pager_type » Required parameter $entity follows optional parameter $pager_type in modules/contrib/stacks/src/TwigExtension/Pagination.php
Version: 2.0.1 » 2.x-dev
Issue summary: View changes

immaculatexavier made their first commit to this issue’s fork.

immaculatexavier’s picture

Status: Active » Needs review

committed in accordance with the aforementioned requirement

mahseri’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for your proactive action

avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
-  public static function getPagination($pager_type = 'default', $entity) {
+  public static function getPagination($entity, $pager_type = 'default') {

Swapping the method parameters causes problems with all the code using that Twig extension. It's sufficient to remove the default argument.

immaculatexavier’s picture

Status: Needs work » Needs review

@apaderno,
Addressed #7, Kindly review and let me know your comments.

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

The last commit in the issue fork fixed it.

hanoii’s picture

Status: Reviewed & tested by the community » Fixed

Thanks a lot! This was already fixed by me before checking on this patch, this is already committed to 2.x. Soon a 3.x for d10 will be released.

hanoii’s picture

Changing supporting organization.

Status: Fixed » Closed (fixed)

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