Getting error on module install.
PHP Fatal error: Default value for parameters with a class type hint can only be NULL in /modules/contrib/select_translation/select_translation.module

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

miteshmap created an issue. See original summary.

miteshmap’s picture

miteshmap’s picture

Assigned: miteshmap » Unassigned
Status: Active » Needs review
ao2’s picture

@miteshmap, the patch looks good, thanks.

I think this error only triggers with PHP < 7.0 because I have never seen it here (PHP 7.0.19).

Can you confirm that? What version of PHP are you using?
I'd like to put this info in the commit message.

If the full error message contains the line numbers, please paste that too.

Ciao ciao,
Antonio

miteshmap’s picture

@ao2: Yes, That's the issue I think, As of now I'm using PHP 5.6

ao2’s picture

OK, thanks for confirming.
I'll test and push the patch soon.

If you can get the full error message with the line numbers in it please post that too.

  • ao2 committed 9196701 on 8.x-1.x authored by miteshmap
    Issue #2879534 by miteshmap: don't use type hints on primitive types
    
    In...
ao2’s picture

Title: fatal error on install » Don't use type hints on primitive types
Status: Needs review » Fixed

I pushed the fix with a more detailed commit message.

I am going to tag a stable release soon.

Ciao,
Antonio

miteshmap’s picture

Thanks Antonio :)

Status: Fixed » Closed (fixed)

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

miteshmap’s picture

Issue summary: View changes