Problem/Motivation
Not exaclty sure what's the difference to PHP5, this might only be a follow-up problem, but PHP 7 doesnt like the $path[0] !== '/')
check if $path is an empty string. Since that doen't seem to work on PHP 5 either, not sure what the real problem is?
One test that fails with this notice is Drupal\simpletest\Tests\BrowserTest
What might be a similar problem is that all installer tests have similar exceptions in template_preprocess_html(), where $path is an empty string as well but it doesn't except that. Somehow it doesn't detect that as frontpage I guess?
Proposed resolution
Add an empty check or prevent that it gets there..
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#6 | interdiff-4-6.txt | 455 bytes | sdstyles |
#6 | php7-substr-2531042-6.patch | 1.1 KB | sdstyles |
#4 | php7-substr-2531042-4.patch | 555 bytes | Berdir |
Comments
Comment #1
dawehner.
Comment #2
BerdirI'm not sure this is novice. I would have uploaded the patch myself if I'd be sure that this i the right fix. But it doesn't make sense. if PHP 5 would get to the same place, then it really should result in the same notice. So why doesn't it?
Comment #3
alexpottAt least for the installer case this is why this is happening http://3v4l.org/iuojJ. This is caused by this behaviour change https://bugs.php.net/bug.php?id=62922 and resolved in https://github.com/symfony/symfony/pull/15282.
Where is our - closed upstream fix status?
Comment #4
BerdirHm. That means 2.7.3 should have fixed this, right?
Drupal\system\Tests\Installer\InstallerTest doesn't fail anymore it seems with 2.7.2 and 2.7.3, but Drupal\simpletest\Tests\BrowserTest still does. I don't think that's related to symfony, but our own code.
I'm not sure why it only happens there, but what we're seeing is the weird behavior of $path[0] being fine if $path is FALSE but if it's an empty string then you get a notice. PHP7--.
Anyway, I think this means that this patch *is* a valid fix for this issue and I confirmed that BrowserTestBase passes then.
Comment #5
alexpottYep I agree this fix looks good. I think we need to fix BrowserTestBase too as it has the same method with the same code.
Comment #6
sdstyles CreditAttribution: sdstyles at FFW commentedHi, fixed it in BrowserTestBase.php too.
Comment #7
sdstyles CreditAttribution: sdstyles at FFW commentedComment #8
neclimdulIt would be fixed by 2.7.3 if we where using it. #2548135: Upgrade to Symfony 2.7.3 could use a rtbc and will probably fix this.
Comment #9
BerdirI don't think so, see #4. There are others that are fixed with that update, but those aren't, this code is completely unrelated to whatever symfony is doing.
Comment #10
alexpottYeah this won't be - it is our
substr()
that is causing this - see https://bugs.php.net/bug.php?id=62922. Committed 9c313e7 and pushed to 8.0.x. Thanks!Comment #11
neclimduloh i see. +1 err fixed! awesome~!