I get this when enabling Pants module after running drush dmu-upgrade on it.

The line in question is:

function pants_user_presave(\Drupal\user\UserInterface $edit = [], \Drupal\user\UserInterface $account = [], \Drupal\user\UserInterface $category = []) {

Also, above that there are not 1, not 2... not even 3! But *6* instances of this:

 * @FIXME
 * The $edit and $category parameters are gone in Drupal 8. They have been left
 * here in order to prevent 'undefined variable' errors, but they will never
 * actually be passed to this hook. You'll need to modify this function and
 * remove every reference to them.

Well as long as we're thorough. :D

Comments

webchick’s picture

Issue tags: +SprintWeekend2015

Well, manually changing those all to NULL instead of [] does indeed seem to fix the problem. And I guess it makes sense, since classes/interfaces !== arrays.

Spun out the multiple @FIXME problem into a separate issue: #2409533: @FIXME for user hooks prints multiple times.

webchick’s picture

Status: Active » Fixed

  • webchick committed 76736cb on 8.x-1.x
    Issue #2409531 by webchick: Fatal error: Default value for parameters...
webchick’s picture

Title: Fatal error: Default value for parameters with a class type hint can only be NULL in pants.module on line 167 » Fatal error: Default value for parameters with a class type hint can only be NULL in hook_user_presave()

Status: Fixed » Closed (fixed)

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