Skip to content

Commit

Permalink
fixes for installer (#1097)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgershman authored Jul 14, 2024
1 parent ca80569 commit 561f006
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release Notes

### 4.3.6 (July 14, 2024)
* Fix for non-loading installer.

### 4.3.5 (May 9, 2024)
* Fix for BMLT based logins not working in some cases.
* Fix for call detail records table on the Reports page that wouldn't render all records. Call events are now in a modal window with a magnifying glass that triggers the open. [#1034]
Expand Down
13 changes: 7 additions & 6 deletions src/app/Http/Middleware/ConfigCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ public function __construct(SettingsService $settingsService)
*/
public function handle(Request $request, Closure $next)
{
// if (!file_exists('./config.php') && !str_ends_with($request->url(), 'installer')) {
// return response()->view(
// 'admin/installer',
// ['minimalRequiredSettings'=>$this->settingsService->minimalRequiredSettings()]
// );
// }
if (!file_exists($this->settingsService->getConfigFilenameForEnvironment())
&& !str_ends_with($request->url(), 'installer')) {
return response()->view(
'admin/installer',
['minimalRequiredSettings'=>$this->settingsService->minimalRequiredSettings()]
);
}

return $next($request);
}
Expand Down
11 changes: 8 additions & 3 deletions src/app/Services/SettingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class SettingsService
{
private string $version = "4.4.0";
private string $version = "4.3.6";
private array $allowlist = [
'announce_servicebody_volunteer_routing' => ['description' => '/helpline/announce_servicebody_volunteer_routing' , 'default' => false, 'overridable' => true, 'hidden' => false],
'blocklist' => ['description' => '/general/blocklist' , 'default' => '', 'overridable' => true, 'hidden' => false],
Expand Down Expand Up @@ -131,8 +131,7 @@ class SettingsService

public function __construct()
{
@include(!getenv("ENVIRONMENT") ? base_path() . '/config.php' :
base_path() . '/config.' . getenv("ENVIRONMENT") . '.php');
@include($this->getConfigFilenameForEnvironment());
$this->settings = get_defined_vars();
$this->localizations = new Localizations();

Expand All @@ -154,6 +153,12 @@ public function __construct()
}
}

public function getConfigFilenameForEnvironment(): string
{
return !getenv("ENVIRONMENT") ? base_path() . '/config.php' :
base_path() . '/config.' . getenv("ENVIRONMENT") . '.php';
}

public function getShortLanguage(): string
{
return $this->shortLanguage;
Expand Down

0 comments on commit 561f006

Please sign in to comment.