Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#5 | 2697777-php7-1.patch | 324 bytes | kim.pepper |
Comments
Comment #2
platinum1 CreditAttribution: platinum1 commentedLooks 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
Comment #3
pythagory CreditAttribution: pythagory at CivicActions commentedI 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.
Comment #4
platinum1 CreditAttribution: platinum1 commentedThat would be great, @pythagory
Comment #5
kim.pepperThis just removes the unused Use statements.
Comment #6
benjy CreditAttribution: benjy at PreviousNext commentedLooks good.
Comment #7
nerdsteinThanks, everyone. I'll get this merged in soon.
Comment #8
platinum1 CreditAttribution: platinum1 commentedCool. Thank you guys!
Comment #9
droath CreditAttribution: droath commentedPatch #5 works for me, any plans on getting it committed soon?
Comment #10
nerdsteinI will be committing it this weekend, yes.
Comment #12
nerdstein