diff --git a/src/Ushahidi/Modules/V5/Repository/Survey/EloquentSurveyRepository.php b/src/Ushahidi/Modules/V5/Repository/Survey/EloquentSurveyRepository.php index 264fb1961..0a0d7cb8e 100644 --- a/src/Ushahidi/Modules/V5/Repository/Survey/EloquentSurveyRepository.php +++ b/src/Ushahidi/Modules/V5/Repository/Survey/EloquentSurveyRepository.php @@ -77,8 +77,18 @@ public function paginate( $query->with($with); } $query->distinct(); + + $results = $query->paginate($paging->getLimit() ? $paging->getLimit() : config('paging.default_laravel_pageing_limit')); - return $query->paginate($paging->getLimit()); + if ($search_fields->showUnknownForm) { + $results->push((new Survey)->fill([ + 'id' => 0, + 'name' => 'Unknown Form', + 'base_language' => 'en', + ])); + } + + return $results; } private function addSurveyTableNamePrefix($fields)