-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Undefined array key "type" Db/SchemaBuilder.php on line 93 #39801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @fokkejan-made-by-mouses. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
#39799 was send in earlier today which should give you some more details about the problem. |
same problem, cannot upgrade to 2.4.7-p5 |
I also have an error when a table becomes disable via db_scheme.xml.
The workaround at this moment is to create a patch and ignore this array keys. |
Same issue as well on our project.
As a workaround, a patch was implemented to check for the existence of the column key before accessing it, in order to avoid warnings when the key is missing from the table definition. Replaced: foreach ($data['table'] as $keyTable => $tableColumns) {
foreach ($tableColumns['column'] as $keyColumn => $columnData) {
if ($columnData['type'] == 'json') {
$tablesWithJsonTypeField[$keyTable] = $keyColumn;
}
}
} With: foreach ($data['table'] as $keyTable => $tableColumns) {
if (!isset($tableColumns['column']) || !is_array($tableColumns['column'])) {
continue; // skip tables without columns
}
foreach ($tableColumns['column'] as $keyColumn => $columnData) {
if (isset($columnData['type']) && $columnData['type'] === 'json') {
$tablesWithJsonTypeField[$keyTable] = $keyColumn;
}
}
} |
Preconditions and environment
Steps to reproduce
Expected result
The upgrade command can be fully executed.
Actual result
We get this error:
Warning: Undefined array key "type" in /var/www/html/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 93
Additional information
Line 93 in vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php assumes that
type
exists for a column.When a column is set to
disabled
, this is not the case.ElasticSuite has this line in db_schema.xml:
<column name="is_used_in_autocomplete" disabled="true"/>
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: