Skip to content

Commit

Permalink
Merge pull request #488 from infinum/feature/airtable-fix
Browse files Browse the repository at this point in the history
5.9.4
  • Loading branch information
iruzevic authored Jan 28, 2025
2 parents 576683b + c274f4e commit 9c1183e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eightshift-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 16 additions & 2 deletions src/Integrations/Airtable/AirtableClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, mixed>
*/
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,
[
Expand All @@ -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 [];
}

Expand Down

0 comments on commit 9c1183e

Please sign in to comment.