Skip to content

Commit 1603f30

Browse files
authored
Merge pull request #57 from phpsa/patch-1
fix: FMBaseBuilder::portalData(): Argument #1 ($array) must be of typ…
2 parents b10ec61 + 5cb3e18 commit 1603f30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Database/Eloquent/FMEloquentBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function editRecord()
160160
// Map the columns to FileMaker fields and strip out read-only fields/containers
161161
$fieldsToWrite = $this->model->getAttributesForFileMakerWrite();
162162

163-
$modifiedPortals = null;
163+
$modifiedPortals = [];
164164
foreach ($fieldsToWrite as $key => $value) {
165165
// Check if the field is a portal (it should be an array if it is)
166166
if (is_array($value)) {
@@ -169,7 +169,7 @@ public function editRecord()
169169
}
170170
}
171171

172-
if ($fieldsToWrite->count() > 0 || count($modifiedPortals ?? []) > 0) {
172+
if ($fieldsToWrite->count() > 0 || count($modifiedPortals) > 0) {
173173
// we have some regular text fields to update
174174
// forward this request to a base query builder to execute the edit record request
175175
$response = $this->query->fieldData($fieldsToWrite->toArray())->portalData($modifiedPortals)->recordId($model->getRecordId())->editRecord();

0 commit comments

Comments
 (0)