Skip to content

Commit

Permalink
Fixed null parameter warnings during installation with DeveloperMode …
Browse files Browse the repository at this point in the history
…enabled (#4030)
  • Loading branch information
fballiano authored Jul 1, 2024
1 parent 1d4fe88 commit b0c7a52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/Varien/Db/Adapter/Pdo/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,7 @@ public function getColumnCreateByDescribe($columnData)
$options['unsigned'] = true;
}
if ($columnData['NULLABLE'] === false
&& !($type == Varien_Db_Ddl_Table::TYPE_TEXT && strlen($columnData['DEFAULT']) != 0)
&& !($type == Varien_Db_Ddl_Table::TYPE_TEXT && isset($columnData['DEFAULT']) && strlen($columnData['DEFAULT']) != 0)
) {
$options['nullable'] = false;
}
Expand All @@ -1781,10 +1781,10 @@ public function getColumnCreateByDescribe($columnData)
) {
$options['default'] = $this->quote($columnData['DEFAULT']);
}
if (strlen($columnData['SCALE']) > 0) {
if (isset($columnData['SCALE']) && strlen($columnData['SCALE']) > 0) {
$options['scale'] = $columnData['SCALE'];
}
if (strlen($columnData['PRECISION']) > 0) {
if (isset($columnData['PRECISION']) && strlen($columnData['PRECISION']) > 0) {
$options['precision'] = $columnData['PRECISION'];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Varien/Db/Ddl/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public function addColumn($name, $type, $size = null, $options = [], $comment =
$precision = $size[0];
$scale = $size[1];
}
} elseif (preg_match('#^(\d+),(\d+)$#', $size, $match)) {
} elseif ($size !== null && preg_match('#^(\d+),(\d+)$#', $size, $match)) {
$precision = $match[1];
$scale = $match[2];
}
Expand Down

0 comments on commit b0c7a52

Please sign in to comment.