Skip to content

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

Open
5 tasks
fokkejan-made-by-mouses opened this issue Apr 10, 2025 · 5 comments
Open
5 tasks
Labels
Reported on 2.4.7-p5 Indicates original Magento version for the Issue report.

Comments

@fokkejan-made-by-mouses
Copy link

fokkejan-made-by-mouses commented Apr 10, 2025

Preconditions and environment

  • Magento version: 2.4.7-p5
  • ElasticSuite version: 2.11.10

Steps to reproduce

  1. Install patch 2.4.7-p5 on an instance with ElasticSuite v2.11.10
  2. Run bin/magento setup:upgrade

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

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Apr 10, 2025

Hi @fokkejan-made-by-mouses. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@hostep
Copy link
Contributor

hostep commented Apr 10, 2025

#39799 was send in earlier today which should give you some more details about the problem.
But that's not a fix for this problem.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.7-p5 Indicates original Magento version for the Issue report. label Apr 10, 2025
@ilnytskyi
Copy link
Contributor

ilnytskyi commented Apr 11, 2025

same problem, cannot upgrade to 2.4.7-p5
I'd suggest assigning Severity: S0
@engcom-Bravo

@fokkejan-made-by-mouses
Copy link
Author

fokkejan-made-by-mouses commented Apr 14, 2025

I also have an error when a table becomes disable via db_scheme.xml.
For example: <table name="akeneo_connector_product_model" disabled="true"/>

Warning: Undefined array key "column" in /var/www/html/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 89

The workaround at this moment is to create a patch and ignore this array keys.

@NikitaNoaks
Copy link

Same issue as well on our project.

vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 89

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;
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reported on 2.4.7-p5 Indicates original Magento version for the Issue report.
Projects
None yet
Development

No branches or pull requests

5 participants