mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
101 stars 52 forks source link

Undefined Index error when requesting payment methods via storeconfig #566

Closed t-heuser closed 1 year ago

t-heuser commented 1 year ago

Describe the bug When requesting all available payment methods via GraphQl in the store_config query while subselected mollie_available_issuers or mollie_meta an error occurs.

Used versions

To Reproduce

Execute the following GraphQl query while having atleast one mollie method acticated:

query storeConfig {
    storeConfig {
        payment_methods {
            mollie_available_issuers {
                name
            }
            mollie_meta {
                image
            }
        }
    }
}

Expected behavior The query works.

Actual behavior The query doesn't work.

Additional context The error:

The error ``` { "errors": [ { "debugMessage": "Warning: Undefined array key \"code\" in \/mnt\/c\/Users\/heuser\/PhpstormProjects\/backend\/vendor\/mollie\/magento2\/GraphQL\/Resolver\/Cart\/AvailableIssuersForMethod.php on line 49", "message": "Internal server error", "extensions": { "category": "internal" }, "locations": [ { "line": 6, "column": 13 } ], "path": [ "storeConfig", "payment_methods", 0, "mollie_available_issuers" ] }, { "debugMessage": "Warning: Undefined array key \"code\" in \/mnt\/c\/Users\/heuser\/PhpstormProjects\/backend\/vendor\/mollie\/magento2\/GraphQL\/Resolver\/Cart\/AvailableIssuersForMethod.php on line 49", "message": "Internal server error", "extensions": { "category": "internal" }, "locations": [ { "line": 6, "column": 13 } ], "path": [ "storeConfig", "payment_methods", 1, "mollie_available_issuers" ] }, { "debugMessage": "Warning: Undefined array key \"code\" in \/mnt\/c\/Users\/heuser\/PhpstormProjects\/backend\/vendor\/mollie\/magento2\/GraphQL\/Resolver\/Cart\/AvailableIssuersForMethod.php on line 49", "message": "Internal server error", "extensions": { "category": "internal" }, "locations": [ { "line": 6, "column": 13 } ], "path": [ "storeConfig", "payment_methods", 2, "mollie_available_issuers" ] }, { "debugMessage": "Warning: Undefined array key \"code\" in \/mnt\/c\/Users\/heuser\/PhpstormProjects\/backend\/vendor\/mollie\/magento2\/GraphQL\/Resolver\/Cart\/AvailableIssuersForMethod.php on line 49", "message": "Internal server error", "extensions": { "category": "internal" }, "locations": [ { "line": 6, "column": 13 } ], "path": [ "storeConfig", "payment_methods", 3, "mollie_available_issuers" ] }, { "debugMessage": "Warning: Undefined array key \"code\" in \/mnt\/c\/Users\/heuser\/PhpstormProjects\/backend\/vendor\/mollie\/magento2\/GraphQL\/Resolver\/Cart\/AvailableIssuersForMethod.php on line 49", "message": "Internal server error", "extensions": { "category": "internal" }, "locations": [ { "line": 6, "column": 13 } ], "path": [ "storeConfig", "payment_methods", 4, "mollie_available_issuers" ] }, { "debugMessage": "Warning: Undefined array key \"code\" in \/mnt\/c\/Users\/heuser\/PhpstormProjects\/backend\/vendor\/mollie\/magento2\/GraphQL\/Resolver\/Cart\/AvailableIssuersForMethod.php on line 49", "message": "Internal server error", "extensions": { "category": "internal" }, "locations": [ { "line": 6, "column": 13 } ], "path": [ "storeConfig", "payment_methods", 5, "mollie_available_issuers" ] }, { "debugMessage": "Warning: Undefined array key \"code\" in \/mnt\/c\/Users\/heuser\/PhpstormProjects\/backend\/vendor\/mollie\/magento2\/GraphQL\/Resolver\/Cart\/AvailableIssuersForMethod.php on line 49", "message": "Internal server error", "extensions": { "category": "internal" }, "locations": [ { "line": 6, "column": 13 } ], "path": [ "storeConfig", "payment_methods", 6, "mollie_available_issuers" ] }, { "debugMessage": "Warning: Undefined array key \"code\" in \/mnt\/c\/Users\/heuser\/PhpstormProjects\/backend\/vendor\/mollie\/magento2\/GraphQL\/Resolver\/Cart\/AvailableIssuersForMethod.php on line 49", "message": "Internal server error", "extensions": { "category": "internal" }, "locations": [ { "line": 6, "column": 13 } ], "path": [ "storeConfig", "payment_methods", 7, "mollie_available_issuers" ] } ], "data": { "storeConfig": { "payment_methods": [ { "mollie_available_issuers": null }, { "mollie_available_issuers": null }, { "mollie_available_issuers": null }, { "mollie_available_issuers": null }, { "mollie_available_issuers": null }, { "mollie_available_issuers": null }, { "mollie_available_issuers": null }, { "mollie_available_issuers": null } ] } } } ```

I know that there is an extra query molliePaymentMethods but the problem with that query is that it doesn't care about anything I set in the adminhtml as configuration for the methods, the title is ignored, which payment methods are activated, etc. Is this another bug or intended behaviour?

Frank-Magmodules commented 1 year ago

Same comment as https://github.com/mollie/magento2/issues/565#issuecomment-1264993118

t-heuser commented 1 year ago

Same comment as https://github.com/mollie/magento2/issues/565#issuecomment-1266861021 :laughing: