mollie / magento2-subscriptions

BSD 2-Clause "Simplified" License
3 stars 5 forks source link

Backend Grid Mollie Subscriptions Item Limit - Values > 250 items per page break the grid #59

Closed ThomasNegeli closed 1 year ago

ThomasNegeli commented 1 year ago

https://github.com/mollie/magento2-subscriptions/blob/main/Model/MollieSubscriptionsListing.php#L98

If the customer enters a value > 250 for subsciptions per page in the backend grid, the grid is broken and no longer usable.

This is due to the API limiting the number of items to 250.

You should force the customer to enter only valid values respecting your api limits.

[2023-06-27T09:35:34.969383+00:00] main.CRITICAL: Mollie\Api\Exceptions\ApiException: [2023-06-27T09:35:34+0000] Error executing API call (400: Bad Request): Limit should be smaller than or equal to 250. Field: limit. Documentation: https://docs.mollie.com/overview/handling-errors in /var/www/src/releases/309/src/vendor/mollie/mollie-api-php/src/Exceptions/ApiException.php:114
Stack trace:
#0 /var/www/src/releases/309/src/vendor/mollie/mollie-api-php/src/HttpAdapter/Guzzle6And7MollieHttpAdapter.php(175): Mollie\Api\Exceptions\ApiException::createFromResponse()
#1 /var/www/src/releases/309/src/vendor/mollie/mollie-api-php/src/HttpAdapter/Guzzle6And7MollieHttpAdapter.php(104): Mollie\Api\HttpAdapter\Guzzle6And7MollieHttpAdapter->parseResponseBody()
#2 /var/www/src/releases/309/src/vendor/mollie/mollie-api-php/src/MollieApiClient.php(673): Mollie\Api\HttpAdapter\Guzzle6And7MollieHttpAdapter->send()
#3 /var/www/src/releases/309/src/vendor/mollie/mollie-api-php/src/MollieApiClient.php(617): Mollie\Api\MollieApiClient->performHttpCallToFullUrl()
#4 /var/www/src/releases/309/src/vendor/mollie/mollie-api-php/src/Endpoints/SubscriptionEndpoint.php(201): Mollie\Api\MollieApiClient->performHttpCall()
#5 /var/www/src/releases/309/src/vendor/mollie/magento2-subscriptions/Model/MollieSubscriptionsListing.php(98): Mollie\Api\Endpoints\SubscriptionEndpoint->page()
#6 /var/www/src/releases/309/src/vendor/magento/framework/View/Element/UiComponent/Context.php(250): Mollie\Subscriptions\Model\MollieSubscriptionsListing->getDataSourceData()
...
Frank-Magmodules commented 1 year ago

We appreciate your effort, @ThomasNegeli, in raising the issue regarding the 250 limit. Rest assured, we will promptly respond to you with further information.

Frank-Magmodules commented 1 year ago

Hello @ThomasNegeli! I'm excited to inform you that we have resolved the bug in our most recent release. You can find the details in our latest release. From now on, the pagination will consistently default to 250, even if a higher per-page number is specified. I will be closing this issue, but please don't hesitate to reopen it if necessary.