Skip to content

[Issue] Add default empty array in constructor #38165

@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #38163: Add default empty array in constructor


Description (*)

This class its constructor argument $tagGenerators is empty by default in PHP, so that via DI argument types in di.xml files the array is filled automatically. This actually means that - without any runtime configuration of this argument - the PHP class has a required argument $tagGenerators.

In my cases, this is breaking DI compile when the modules Magento_DirectoryGraphQl and Magento_StoreGraphQl are disabled (and actually a lot of people will disable this module if they are not building a headless shop). This PR is a simple but required fix.

Related Pull Requests

None

Fixed Issues (if relevant)

None

Manual testing scenarios (*)

Install Magento 2. Next, add a composer replacement of magento/module-store-graph-ql and magento/module-directory-graph-ql and run composer update to remove these dependencies. Alternatively, just disable the modules Magento_DirectoryGraphQl and Magento_StoreGraphQl. Next, run bin/magento setup:di:compile. It should fail. With this patch, it should work.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

Labels

Area: FrameworkComponent: StoreIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: doneReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions