I'm trying to upgrade a site from ProcessWire 3.0.229 to 3.0.246 so that I can upgrade the PHP version the site is running on from 7.4 to 8.3. PDO Statements such as the one below used to return the value of type as a string, now they return the value as an integer. This is a breaking change as we have many literal comparisons in the site. Is this a setting that can be changed?
E.g.
$query = $this->database->prepare("SELECT fundraiser, `type`, `order` FROM deliveries
WHERE `driver` = :driver
AND `type` != 2
AND `removed` != 1
AND `fundraiser` IS NOT NULL
ORDER BY time ASC");
$query->bindValue(':driver', $params['driverId']);
$query->execute();
$result = $query->fetchAll(\PDO::FETCH_ASSOC);
$ids = [];
foreach ($result as $item) {
if ($item["type"] === "0") {
$ids[] = $item["business"];
} elseif ($item["order"]) {
$ids[] = $item["order"];
}
}
Also this selector return ID as a int and not a string.
$selector = "template=Group, sort=title";
$groups = $this->pages->findRaw($selector, ['id','title']);
foreach($groups as $group) {
$groupsArray[] = [
'id' => $group['id'],
'title' => $group['title'] ?? '',
];
}