Problem/Motivation

When using this module with PHP 8.0, if the PHP error handler gets called, you'll get this error:

ArgumentCountError: Too few arguments to function MigrationBase::errorHandler(), 4 passed and exactly 5 expected in MigrationBase->errorHandler()

This is due to the $context argument being removed in PHP 8.0:

https://www.php.net/manual/en/function.set-error-handler#refsect1-functi...

Steps to reproduce

Use this module and get an error. :-)

Proposed resolution

I'll attach a patch in a moment that will work with both PHP 7 and 8.0

Remaining tasks

  1. Make patch
  2. Review
  3. Commit!

User interface changes

None

API changes

Adding a default to the 5th argument of MigrationBase::errorHandler()

Data model changes

None

CommentFileSizeAuthor
#2 migrate-php80-3253653-2.patch624 bytesdsnopek

Comments

dsnopek created an issue. See original summary.

dsnopek’s picture

Status: Active » Needs review
StatusFileSize
new624 bytes

Here's the patch!

loopy1492’s picture

Thanks so much @dsnopek. That patch got my build running succesfully.

dsnopek’s picture

Issue tags: +panopoly
damienmckenna’s picture

Issue tags: +PHP 8.0
joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Seems reasonable, assuming something extending the base hasn't passed through the number of arguments is in this module or that last parameter was a new addition in either case this will help

joseph.olstad’s picture

Issue tags: +PHP 8.1, +PHP 8.2

  • pifagor committed 905e8245 on 7.x-2.x authored by dsnopek
    Issue #3253653 by dsnopek, loopy1492, pifagor, DamienMcKenna, joelpittet...
pifagor’s picture

Status: Reviewed & tested by the community » Fixed
joseph.olstad’s picture

Status: Fixed » Closed (fixed)

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