Skip to content

Commit b9ccf9a

Browse files
committed
Fix for appending a computed field
This will fix issue buildwithyab#46 Signed-off-by: Alan Wynn <alan.wynn@me.com>
1 parent 1c082f4 commit b9ccf9a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Services/ModelService.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ public function getFullTextIndexFields()
4040
foreach ($searchableFields as $searchableField) {
4141

4242
//@TODO cache this.
43-
$columnType = DB::connection($this->connectionName)->
44-
select("SHOW FIELDS FROM $this->tableName where Field = ?", [$searchableField])[0]->Type;
43+
$sql = "SHOW FIELDS FROM $this->tableName where Field = ?";
44+
$column = DB::connection($this->connectionName)->select($sql, [$searchableField]);
45+
46+
if (!isset($column[0])) {
47+
continue;
48+
}
49+
50+
$columnType = $column[0]->Type;
4551

4652
if ($this->isFullTextSupportedColumnType($columnType)) {
4753
$indexFields[] = $searchableField;

0 commit comments

Comments
 (0)