Closed JimBacon closed 1 year ago
@JimBacon & @johnvanbreda I have upgraded all warehouse to PHP version of 8.0.19.
Info : also, upgraded testwarehouse from 6.12.20 to 8.0 & devwarehouse from 7.1 to 8.0.
@johnvanbreda I have created new site for PHP 8.1 and restored backup from live site to this site. I found below errors. I think that is the start point to resolve errors or warnings for PHP 8.1. The iRecord development site URL is -> https://dev-brc-test-irecord.pantheonsite.io
There may be more which I will add in due course.
Some more ....
PHP 8.1 /index.php/setup_check/config_email_save
Error on screen:
Email configuration test failed - Passing null to parameter #2 ($subject) of type string is deprecated
In log:
--- error: #8192: Error converted to exception. preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated at line 384 in file ***/system/vendor/swift/Swift/Message/Encoder.php
Hi @jendrage, does the log include the call stack? If so, could you post it. Thanks.
Looking at the code, is it possible that either of the the following box were not completed on the email test form?
Hi Jim, no sorry just this:
2023-10-31 09:40:47 +00:00 --- error: #8192: Error converted to exception. preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated at line 384 in file ***/system/vendor/swift/Swift/Message/Encoder.php 2023-10-31 09:40:47 +00:00 --- error: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
I switched back to PHP 7.4 temparility to save the email conifg and that worked fine, test email sent and all good.
Just tested again with PHP 8.1, to double check, all boxes filled in correctly and same error.
Not urgent as I have the email config saved and working, just logging as a PHP 8.1 error.
In order to get richer logging, the log_threshold
setting in application/config/config.php can be set to 4 - then it will include a call stack. I'm not sure if this is too late as you are now set up @jendrage so this may have to wait till Jim or I get a chance to do a test warehouse install.
Here you go:
2023-10-31 12:46:49 +00:00 --- debug: Global GET, POST and COOKIE data sanitized 2023-10-31 12:46:49 +00:00 --- debug: Session Cookie Driver Initialized 2023-10-31 12:46:49 +00:00 --- debug: Session Library initialized 2023-10-31 12:46:49 +00:00 --- error: #8192: Error converted to exception. preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated at line 384 in file /public_html/system/vendor/swift/Swift/Message/Encoder.php 2023-10-31 12:46:49 +00:00 --- debug: Stack trace: Unknown file - line Unknown - indicia_error_handler /public_html/system/vendor/swift/Swift/Message/Encoder.php - line 384 - preg_match /public_html/system/vendor/swift/Swift/Message/Headers.php - line 286 - isUTF8 /public_html/system/vendor/swift/Swift/Message.php - line 385 - setAttribute /public_html/system/vendor/swift/Swift/Message.php - line 92 - setCharset /public_html/modules/indicia_setup/controllers/setup_check.php - line 188 - __construct Unknown file - line Unknown - config_email_save /public_html/system/core/Kohana.php - line 291 - invokeArgs /public_html/system/core/Event.php - line 209 - instance /public_html/system/core/Bootstrap.php - line 55 - run /public_html/index.php - line 112 - require 2023-10-31 12:46:49 +00:00 --- error: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
Thanks @jendrage, I've committed a fix to the core Kohana code to the develop branch.
@johnvanbreda There are also errors with PHP 8.1 with swift mailer when the cron jobs are run:
2023-11-24 14:50:14 +00:00 --- error: #8192: Error converted to exception. strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at line 209 in file ***/system/vendor/swift/Swift/Message/Mime.php
2023-11-24 14:50:14 +00:00 --- debug: Stack trace:
Unknown file - line Unknown - indicia_error_handler
***/system/vendor/swift/Swift/Message/Mime.php - line 209 - strtolower
***/system/vendor/swift/Swift/Message.php - line 94 - setEncoding
***/application/controllers/scheduled_tasks.php - line 655 - __construct
***/application/controllers/scheduled_tasks.php - line 104 - doRecordOwnerNotifications
Unknown file - line Unknown - index
***/system/core/Kohana.php - line 291 - invokeArgs
***/system/core/Event.php - line 209 - instance
***/system/core/Bootstrap.php - line 55 - run
***/index.php - line 112 - require
That can be fixed with your ?? '' trick. :-) But then we get this one:
2023-11-24 14:53:59 +00:00 --- error: #8192: Error converted to exception. Function gmstrftime() is deprecated at line 168 in file ***/system/vendor/swift/Swift/Message.php
2023-11-24 14:53:59 +00:00 --- debug: Stack trace:
***/system/vendor/swift/Swift/Message.php - line 168 - indicia_error_handler
***/system/vendor/swift/Swift.php - line 371 - generateId
***/application/controllers/scheduled_tasks.php - line 660 - send
***/application/controllers/scheduled_tasks.php - line 104 - doRecordOwnerNotifications
Unknown file - line Unknown - index
***/system/core/Kohana.php - line 291 - invokeArgs
***/system/core/Event.php - line 209 - instance
***/system/core/Bootstrap.php - line 55 - run
***/index.php - line 112 - require
Looks like Swift Mailer is no longer maintained. However, according to their website the latest version does support 8.1.
`
Hi. Have you pulled the latest version of the code? I did some fixes in this area within the last fortnight.
@JimBacon Brill, I've done that and emails are sending now :-) Sorry, I had manually applied a couple of your fixes on this thread but hadn't updated the whole codebase before. Sorted now, thank you.
Running continuous integration tests with PHP 8.1 results in failure. Some faults originating in Kohana code were noted. All support for PHP 8.0 ends on 26 Nov, 2023
Note that Kohana 3 (we are still on v2) lives on and is being maintained. https://github.com/koseven/koseven