Skip to content
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

Cannot save API key in Mollie v2.35.0 #752

Closed
KathiD303 opened this issue Feb 26, 2024 · 4 comments
Closed

Cannot save API key in Mollie v2.35.0 #752

KathiD303 opened this issue Feb 26, 2024 · 4 comments
Labels
Fixed and planned for next release Fix will be included in the next release. Question / Issue Further information is requested

Comments

@KathiD303
Copy link

Describe the bug
Cannot save the API key in Mollie v2.35.0

Used versions

  • *Magento Version number: 2.4.5-p6
  • Open source/Enterprise/B2b: Enterprise
  • Mollie version number (Check configuration): 2.35.0

To Reproduce
Steps to reproduce the behavior:

  1. Go to Mollie General settings in Magento backend.
  2. Insert Test API Key and select mode "Test".
  3. Save config.

Expected behavior
API key can be saved.

Actual behavior
API key can be saved and remains empty. Error: Something went wrong while saving this configuration: [2024-02-26T15:38:17+0000] Invalid API key: ''. An API key must start with 'test_' or 'live_' and must be at least 30 characters long

@Frank-Magmodules Frank-Magmodules added the Question / Issue Further information is requested label Feb 26, 2024
@ImanuelBertrand
Copy link
Contributor

ImanuelBertrand commented Feb 26, 2024

I can confirm this behaviour. Both TEST and LIVE api keys were filled when saving the form.

[2024-02-26T15:25:54.843492+00:00] report.CRITICAL: Exception message: [2024-02-26T15:25:54+0000] Invalid API key: ''. An API key must start with 'test_' or 'live_' and must be at least 30 characters long.
Trace: <pre>#1 Mollie\Payment\Service\Mollie\MollieApiClient->loadByApiKey() called at [vendor/mollie/magento2/Model/Adminhtml/Backend/UpdateProfileId.php:36]
#2 Mollie\Payment\Model\Adminhtml\Backend\UpdateProfileId->execute() called at [vendor/mollie/magento2/Model/Adminhtml/Backend/ChangeApiMode.php:72]
#3 Mollie\Payment\Model\Adminhtml\Backend\ChangeApiMode->afterSave() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#4 Mollie\Payment\Model\Adminhtml\Backend\ChangeApiMode\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#5 Mollie\Payment\Model\Adminhtml\Backend\ChangeApiMode\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#6 Mollie\Payment\Model\Adminhtml\Backend\ChangeApiMode\Interceptor->___callPlugins() called at [generated/code/Mollie/Payment/Model/Adminhtml/Backend/ChangeApiMode/Interceptor.php:23]
#7 Mollie\Payment\Model\Adminhtml\Backend\ChangeApiMode\Interceptor->afterSave() called at [vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php:842]
#8 Magento\Framework\Model\ResourceModel\Db\AbstractDb->processAfterSaves() called at [vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php:402]
#9 Magento\Framework\Model\ResourceModel\Db\AbstractDb->save() called at [vendor/magento/framework/Model/AbstractModel.php:658]
#10 Magento\Framework\Model\AbstractModel->save() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#11 Mollie\Payment\Model\Adminhtml\Backend\ChangeApiMode\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#12 Mollie\Payment\Model\Adminhtml\Backend\ChangeApiMode\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#13 Mollie\Payment\Model\Adminhtml\Backend\ChangeApiMode\Interceptor->___callPlugins() called at [generated/code/Mollie/Payment/Model/Adminhtml/Backend/ChangeApiMode/Interceptor.php:32]
#14 Mollie\Payment\Model\Adminhtml\Backend\ChangeApiMode\Interceptor->save() called at [vendor/magento/framework/DB/Transaction.php:134]
#15 Magento\Framework\DB\Transaction->save() called at [vendor/magento/module-config/Model/Config.php:214]
#16 Magento\Config\Model\Config->save() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#17 Magento\Config\Model\Config\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#18 Magento\Config\Model\Config\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#19 Magento\Config\Model\Config\Interceptor->___callPlugins() called at [generated/code/Magento/Config/Model/Config/Interceptor.php:23]
#20 Magento\Config\Model\Config\Interceptor->save() called at [vendor/magento/module-config/Controller/Adminhtml/System/Config/Save.php:226]
#21 Magento\Config\Controller\Adminhtml\System\Config\Save->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#22 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#23 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#24 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Config/Controller/Adminhtml/System/Config/Save/Interceptor.php:23]
#25 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111]
#26 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:151]
#27 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/module-config/Controller/Adminhtml/System/AbstractConfig.php:69]
#28 Magento\Config\Controller\Adminhtml\System\AbstractConfig->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#29 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#30 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:145]
#31 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#32 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#33 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Config/Controller/Adminhtml/System/Config/Save/Interceptor.php:32]
#34 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:245]
#35 Magento\Framework\App\FrontController->getActionResponse() called at [vendor/magento/framework/App/FrontController.php:212]
#36 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:147]
#37 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#38 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#39 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#40 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#41 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#42 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#43 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]
</pre> [] []

@Frank-Magmodules Frank-Magmodules added the Fixed and planned for next release Fix will be included in the next release. label Feb 26, 2024
@gexxx05
Copy link

gexxx05 commented Feb 27, 2024

Hotfix:

Change the backend model of field "type" to old value like it was in v2.34.0.
Note that changing core files is not a good idea and you should create a patch for this.

In File vendor\mollie\magento2\etc\adminhtml\system.xml change

<field id="type" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Modus</label>
    <backend_model>Mollie\Payment\Model\Adminhtml\Backend\ChangeApiMode</backend_model>
    <source_model>Mollie\Payment\Model\Adminhtml\Source\ApiKey</source_model>
    <config_path>payment/mollie_general/type</config_path>
</field>

to

<field id="type" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Modus</label>
    <backend_model>Mollie\Payment\Model\Adminhtml\Backend\FlushMollieCache</backend_model>
    <source_model>Mollie\Payment\Model\Adminhtml\Source\ApiKey</source_model>
    <config_path>payment/mollie_general/type</config_path>
</field>

Afterwards flush magento cache and try again.

@joachimVT
Copy link

I can also confirm this behaviour. Both TEST and LIVE api keys were filled when saving the form.

*Magento Version number: 2.4.6-p4
Open source/Enterprise/B2b: Open source
Mollie version number (Check configuration): 2.35.0

michielgerritsen added a commit to michielgerritsen/mollie-magento2 that referenced this issue Feb 28, 2024
@Frank-Magmodules
Copy link
Collaborator

Hello @joachimVT , @KathiD303 , and @ImanuelBertrand , thank you for opening this issue. We've solved the issue in a new release, version 2.35.1. Apologies for the inconvenience caused, and we appreciate your feedback. I'll mark this issue as resolved for now, but please don't hesitate to reopen it if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed and planned for next release Fix will be included in the next release. Question / Issue Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants