Skip to content

Commit eea8a8e

Browse files
committed
add showUnknownForm to new survey paginate
1 parent a440fd3 commit eea8a8e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Ushahidi/Modules/V5/Repository/Survey/EloquentSurveyRepository.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,18 @@ public function paginate(
7777
$query->with($with);
7878
}
7979
$query->distinct();
80+
81+
$results = $query->paginate($paging->getLimit() ? $paging->getLimit() : config('paging.default_laravel_pageing_limit'));
8082

81-
return $query->paginate($paging->getLimit());
83+
if ($search_fields->showUnknownForm) {
84+
$results->push((new Survey)->fill([
85+
'id' => 0,
86+
'name' => 'Unknown Form',
87+
'base_language' => 'en',
88+
]));
89+
}
90+
91+
return $results;
8292
}
8393

8494
private function addSurveyTableNamePrefix($fields)

0 commit comments

Comments
 (0)