From ef0e0a717551cc30f09ff44221c05ffa83371b90 Mon Sep 17 00:00:00 2001 From: Kamil Wylegala Date: Tue, 4 Jan 2022 16:55:02 +0100 Subject: [PATCH] Fixed: "strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated" --- lib/Cake/Model/Datasource/Database/Mysql.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index 2d70ac7e4..fb8a3455e 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -361,7 +361,8 @@ class Mysql extends DboSource { $fields[$column->Field]['unsigned'] = $this->_unsigned($column->Type); } if (in_array($fields[$column->Field]['type'], array('timestamp', 'datetime')) && - in_array(strtoupper($column->Default), array('CURRENT_TIMESTAMP', 'CURRENT_TIMESTAMP()')) + //Falling back to default empty string due to PHP8.1 deprecation notice. + in_array(strtoupper($column->Default ?? ""), array('CURRENT_TIMESTAMP', 'CURRENT_TIMESTAMP()')) ) { $fields[$column->Field]['default'] = null; }