Skip to content

[Issue] Avoid exception when config.xml nodes exist for not-installed payment methods #29555

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #27940: Avoid exception when config.xml nodes exist for not-installed payment methods


Preconditions (*)

Magento 2.4-develop
When a payment configuration node exists in XML but there is no <model> defined, getList() will throw an UnexpectedValueException. One use case for creating such a set-up is a module that provides default configuration overrides for payment methods which are not installed on the current website. For example:

<config>
  <default>
    <payment>
      <checkmo>
        <active>0</active>
      </checkmo>
      <not_installed_here>
        <debug>0</debug>
        <environment>production</environment>
      </not_installed_here>
    </payment>
  </default>
</config>

In this case, the payment method not_installed_here does not have a <model> node defined, as the payment method module is not installed on the website.

Steps to reproduce (*)

  1. Add supplied XML or similar to a local module's config.xml
  2. Browse to checkout with an item in basket
  3. Observe (lack of) exception thrown during checkout page load

Expected result (*)

Actual result (*)

Additional information
I have not yet written/changed any unit/functional tests for this change. I suspect some existing tests may fail which I will review at a later date.

Metadata

Metadata

Labels

Component: PaymentFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions