Upon enabling the module on the current DEV of D8.1.x I get the following error:

[31-Mar-2016 16:54:56 Europe/Zurich] PHP Fatal error: Cannot use Drupal\Component\Utility\String as String because 'String' is a special class name in /home/solution/public_html/my-domain.com/modules/contrib/password_policy/password_policy.module on line 3

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

platinum1 created an issue. See original summary.

platinum1’s picture

Looks like this is related to PHP7. String is now a reserved word in PHP7.

More info can be found at https://www.drupal.org/node/2457593

pythagory’s picture

I think that class (Drupal\Component\Utility\String) has been deprecated or renamed. Related core issue is here: https://www.drupal.org/node/2454447

This might be a moot point, though - a quick scan of the codebase makes it look like that class isn't even being used here and we might be able to just remove the offending use statements. I'll see about writing up a quick patch later this evening.

platinum1’s picture

That would be great, @pythagory

kim.pepper’s picture

Status: Active » Needs review
FileSize
324 bytes

This just removes the unused Use statements.

benjy’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

nerdstein’s picture

Thanks, everyone. I'll get this merged in soon.

platinum1’s picture

Cool. Thank you guys!

droath’s picture

Patch #5 works for me, any plans on getting it committed soon?

nerdstein’s picture

Assigned: Unassigned » nerdstein

I will be committing it this weekend, yes.

  • nerdstein committed 0687f81 on 8.x-3.x authored by kim.pepper
    Issue #2697777 by kim.pepper: PHP Fatal error:  'String' is a special...
nerdstein’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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