diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dba30cc..590fe3bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/). +## [5.9.4] + +### Fixed + +- `Airtable` integration fix for more than 100 records. + ## [5.9.3] ### Fixed @@ -547,6 +553,12 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a - Filter `script_dependency_theme` is now `script_dependency_theme_captcha`. +## [3.1.13] + +### Fixed + +- `Airtable` integration fix for more than 100 records. + ## [3.1.12] ### Fixed @@ -995,6 +1007,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a - Initial production release. +[5.9.4]: https://github.com/infinum/eightshift-forms/compare/5.9.3...5.9.4 [5.9.3]: https://github.com/infinum/eightshift-forms/compare/5.9.2...5.9.3 [5.9.2]: https://github.com/infinum/eightshift-forms/compare/5.9.1...5.9.2 [5.9.1]: https://github.com/infinum/eightshift-forms/compare/5.9.0...5.9.1 @@ -1051,7 +1064,8 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a [4.0.3]: https://github.com/infinum/eightshift-forms/compare/4.0.2...4.0.3 [4.0.2]: https://github.com/infinum/eightshift-forms/compare/4.0.1...4.0.2 [4.0.1]: https://github.com/infinum/eightshift-forms/compare/4.0.0...4.0.1 -[4.0.0]: https://github.com/infinum/eightshift-forms/compare/3.1.12...4.0.0 +[4.0.0]: https://github.com/infinum/eightshift-forms/compare/3.1.13...4.0.0 +[3.1.13]: https://github.com/infinum/eightshift-forms/compare/3.1.12...3.1.13 [3.1.12]: https://github.com/infinum/eightshift-forms/compare/3.1.11...3.1.12 [3.1.11]: https://github.com/infinum/eightshift-forms/compare/3.1.10...3.1.11 [3.1.10]: https://github.com/infinum/eightshift-forms/compare/3.1.9...3.1.10 diff --git a/eightshift-forms.php b/eightshift-forms.php index 9ced9774..a9fca8c1 100644 --- a/eightshift-forms.php +++ b/eightshift-forms.php @@ -6,7 +6,7 @@ * Description: Eightshift Forms is a complete form builder plugin that utilizes modern Block editor features with multiple third-party integrations, bringing your project to a new level. * Author: WordPress team @Infinum * Author URI: https://eightshift.com/ - * Version: 5.9.3 + * Version: 5.9.4 * Text Domain: eightshift-forms * * @package EightshiftForms diff --git a/src/Integrations/Airtable/AirtableClient.php b/src/Integrations/Airtable/AirtableClient.php index 3ff6066c..4eba7035 100644 --- a/src/Integrations/Airtable/AirtableClient.php +++ b/src/Integrations/Airtable/AirtableClient.php @@ -314,13 +314,18 @@ private function getAirtableListFields(string $baseId) * * @param string $baseId Base id to search. * @param string $listId List id to search. + * @param string $offset Offset value. * * @return array */ - private function getAirtableListRecords(string $baseId, string $listId) + private function getAirtableListRecords(string $baseId, string $listId, string $offset = ''): array { $url = self::BASE_URL . "{$baseId}/{$listId}"; + if ($offset) { + $url .= "?offset={$offset}"; + } + $response = \wp_remote_get( $url, [ @@ -342,9 +347,18 @@ private function getAirtableListRecords(string $baseId, string $listId) // On success return output. if ($code >= UtilsConfig::API_RESPONSE_CODE_SUCCESS && $code <= UtilsConfig::API_RESPONSE_CODE_SUCCESS_RANGE) { - return $body['records'] ?? []; + $data = $body['records'] ?? []; + $offset = $body['offset'] ?? ''; + + // If we have more that 100 records, we need to fetch them all. + if ($offset) { + $data = \array_merge($data, $this->getAirtableListRecords($baseId, $listId, $offset)); + } + + return $data; } + return []; }