Problem/Motivation

After migrating from PHP 7.4 to PHP 8.0 we've started seeing these errors:

Warning: Drupal\agreement\AgreementHandler::Drupal\agreement\{closure}(): Argument #1 ($result) must be passed by reference, value given in Drupal\agreement\AgreementHandler->getAgreementByUserAndPath() (line 154 of modules/contrib/agreement/src/AgreementHandler.php).

Steps to reproduce

Install the module with PHP 8.0 - the warnings will appear straight away.

Proposed resolution

Get rid of unneeded passing by reference in all cases.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork agreement-3254494

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

Spleshka created an issue. See original summary.

spleshka’s picture

Status: Active » Needs review
StatusFileSize
new2.15 KB

The patch is ready for review.

hmendes’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new85.5 KB

The patch from #2 solved the problem. The print shows the errors before the patch, after applying it, no errors are shown.

  • mradcliffe committed e8989c6 on 3.0.x authored by Spleshka
    Issue #3254494 by Splushka, hmendes: Fixes pass by reference in...
mradcliffe’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for the patch and manual test. I committed this in commit e8989c6.

I apologize for not getting to this sooner.

Status: Fixed » Closed (fixed)

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

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