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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3254494_before.png | 85.5 KB | hmendes |
| #2 | agreement-php-8-warnings-3254494-2.patch | 2.15 KB | spleshka |
Issue fork agreement-3254494
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
Comment #2
spleshkaThe patch is ready for review.
Comment #3
hmendes commentedThe patch from #2 solved the problem. The print shows the errors before the patch, after applying it, no errors are shown.
Comment #5
mradcliffeThank you for the patch and manual test. I committed this in commit e8989c6.
I apologize for not getting to this sooner.