Hi @kolohe280, thanks for raising this. Backlight 6 strives to be compatible with PHP 8.5 - it’s updated according to the documentation and I run 8.5 for my development.
I’ll look into this to see what might have been missed.
Hi @kolohe280, are you still able to use the Backlight Modules page, or does this error prevent it from loading? If you are able to, then a simple update from us should be able to fix it without you needing to manually update and re-run the installer.
OK, I did a little looking around and here’s what I found. I’m running on IONOS, btw.
If I set this domain to PHP 8.5 (they are running 8.5.2 according to phpinfo) the module page loads but does not populate. It works fine on 8.4. phpinfo shows that curl is enabled. So, I should be able to install a fix while on 8.4, switch it to 8.5, and test.
Hi @kolohe280, thanks for checking. We’ve just released an update that addresses this and a few other deprecated functions in PHP 8.5.
If you’re able to switch back to 8.4, upgrade and then back to 8.5 then that would be great. Can you also confirm that the issue is no longer there once you’ve upgraded and are on 8.5?
I will need to provide separate advice for other users if they are unable to temporarily change back to an older version.
I ran the upgrade an 8.4. It was successful but when I switched to 8.5 the error is still there.
I noticed that when I switched from 8.5 back to 8.4 the error appeared there until I cleared the template cache. I have tried doing that on 8.5, but it did not remedy the situation.
I’m seeing something similar.
On my test site, I updated php from 8.2 to 8.5.2 and the site looked fine and I had access to Backlight.
Backlight was running 6.4.2.
I updated Backlight to 6.4.3 and got this error:
Hi @kolohe280 and @rod_barbee, thanks for letting me know. It’s not meant to be like this. Is there a line number that’s being reported? Can I also confirm the page you’re on? Is this just by visiting the Backlight modules page without further action?
I feel that the behaviour of PHP has changed. That it’s reporting issues with lines of code that exist even if those lines of code are not executed. The approach I took, which I’ve done without issue before, was to have a version check: anything PHP 8.0 or above would use the new approach, anything below PHP 8 would use the old. (The new method is only available for PHP 8.0 or above).
That’s interesting. I can no longer suppress it on my end on PHP 8.5. Because the error comes up without the line of code being run, even temporarily turning off deprecated warnings before the line doesn’t work. I can’t think of any way around this other than disabling these warnings entirely, which isn’t great - we’ve always had the philosophy of reporting all issues to help us with the quality of our code.
Hi @kolohe280, thanks! We’ve release a further update that addresses this. Can you try updating your Backlight Modules and let me know whether the error has disappeared in Backlight 8.5?
This has taken some nutting out. It appears that $http_response_header is handled in a special way by PHP, so this looks to be a unique scenario that is different from the other work done to handle deprecation.
Hi @kolohe280, thanks for confirming and for the kind words!
I downloaded the source code for PHP itself and there’s actually a check for this one variable in the code compiler that throws this message. That explains why it was coming up despite extra code checks I put in place to work around it.