File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,17 @@ 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 ]);
4545
46+ if (!isset ($ column [0 ])) {
47+ continue ;
48+ }
49+
50+ $ columnType = $ column [0 ]->Type ;
51+
52+ // When using `$appends` to include an accessor for a field that doesn't exist,
53+ // an ErrorException will be thrown for `Undefined Offset: 0`
4654 if ($ this ->isFullTextSupportedColumnType ($ columnType )) {
4755 $ indexFields [] = $ searchableField ;
4856 }
You can’t perform that action at this time.
0 commit comments