Skip to content

Commit

Permalink
Fix intro/fulltext images and urla,urlb,urlc feature in Airtable example
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr Alexandre ELISÉ committed Nov 10, 2022
1 parent e7feec2 commit 28e9484
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

if (empty($airtableResponse))
{
yield new RuntimeException("Url MUST NOT be empty", 422);
yield new RuntimeException("Airtable Response MUST NOT be empty", 422);
}

$defaultKeys = [
Expand Down Expand Up @@ -97,6 +97,11 @@
{
unset($record->fields->$fieldKey);
}
if (is_string($fieldValue) && mb_strpos($fieldValue, '{') === 0)
{
//IMPORTANT: This one line allows to see intro/fulltext images and urla,urlb,urlc
$record->fields->$fieldKey = json_decode(str_replace(["\n", "\r", "\t"], '', trim($fieldValue)));
}
}
// Re-encode the fields to send it back as JSON
yield json_encode($record->fields);
Expand Down

0 comments on commit 28e9484

Please sign in to comment.