mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix type handling in JSON decode for migration script
Ensure `json_decode` explicitly casts database values to strings to avoid type errors during migration. This prevents potential issues when processing `options` fields that may not already be of string type.
This commit is contained in:
parent
3b0a4e9c73
commit
1955249a60
@ -31,7 +31,7 @@ final class Version20250404123326 extends AbstractMigration
|
||||
$result = $this->connection->executeQuery('SELECT id, options FROM chill_main_saved_export');
|
||||
|
||||
foreach ($result->iterateAssociative() as $row) {
|
||||
$options = json_decode($row['options'], true, 512, JSON_THROW_ON_ERROR);
|
||||
$options = json_decode((string) $row['options'], true, 512, JSON_THROW_ON_ERROR);
|
||||
$this->addSql(
|
||||
'UPDATE chill_main_saved_export SET options = :new_options WHERE id = :id',
|
||||
['id' => $row['id'], 'new_options' => SavedExportOptionsMigrator::migrate($options)],
|
||||
|
Loading…
x
Reference in New Issue
Block a user