Skip to content

Commit a601be3

Browse files
committed
Stan fixes
1 parent b556853 commit a601be3

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/CollectionDataTable.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ public function columnSearch(): void
104104
for ($i = 0, $c = count($this->request->columns()); $i < $c; $i++) {
105105
$column = $this->getColumnName($i);
106106

107+
if (is_null($column)) {
108+
continue;
109+
}
110+
107111
if (! $this->request->isColumnSearchable($i) || $this->isBlacklisted($column)) {
108112
continue;
109113
}

src/DataTableAbstract.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,10 @@ protected function getColumnName(int $index, bool $wantsAlias = false): ?string
981981
{
982982
$column = $this->request->columnName($index);
983983

984+
if (is_null($column)) {
985+
return null;
986+
}
987+
984988
// DataTables is using make(false)
985989
if (is_numeric($column)) {
986990
$column = $this->getColumnNameByIndex($index);

src/QueryDataTable.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ public function columnSearch(): void
252252
foreach ($columns as $index => $column) {
253253
$column = $this->getColumnName($index);
254254

255+
if (is_null($column)) {
256+
continue;
257+
}
258+
255259
if (! $this->request->isColumnSearchable($index) || $this->isBlacklisted($column) && ! $this->hasFilterColumn($column)) {
256260
continue;
257261
}
@@ -755,6 +759,7 @@ protected function globalSearch(string $keyword): void
755759
->map(function ($index) {
756760
return $this->getColumnName($index);
757761
})
762+
->filter()
758763
->reject(function ($column) {
759764
return $this->isBlacklisted($column) && ! $this->hasFilterColumn($column);
760765
})

0 commit comments

Comments
 (0)