Closed emteknetnz closed 1 year ago
I don't think this actually solves the problem - users are going to get different behaviour depending on what database version is used which is not good.
I didn't realise you had already created this PR and was working on the same issue from the recipe-solr-search
broken build and created this PR: https://github.com/silverstripe/cwp/pull/312
I think it's better to fix the problem and always return the same error to the user rather than allowing the exception to throw for mysql8.0
Changed solution, this matches behavior to PHP < 8.1
PHP 8.1 set the MySQLi default error mode to exceptions https://php.watch/versions/8.1/mysqli-error-mode
This resulted in https://github.com/silverstripe/cwp/runs/7351123074?check_suite_focus=true
It would have been nice to just add
| DatabaseException
to https://github.com/silverstripe/cwp/blob/192a9025ccac935d3bc605fcc56a76002848b4a5/src/PageTypes/DatedUpdateHolderController.php#L178 as talked about hereHowever the failing FunctionalTest (which makes an HTTP request to the frontend) simply doesn't go through this bit of code.