Skip to content

Commit cef51cf

Browse files
committed
Installation: Add item to cache that allows to keep active the installation menu if any migration or setup configuration fails
1 parent 2e75599 commit cef51cf

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/Controllers/InstallController.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public function index()
6868
$inactive_migrations = $this->inactiveMigrations();
6969

7070
if (!$this->isInstalled()) {
71+
\Cache::forever('panichd::installation', 'install');
72+
7173
// Panic Help Desk is not installed yet
7274

7375
$previous_ticketit = Schema::hasTable('ticketit_settings');
@@ -122,6 +124,10 @@ public function upgrade_menu()
122124
*/
123125
public function isInstalled()
124126
{
127+
// Not installed if we're in installation process
128+
if (\Cache::has('panichd::installation')) return false;
129+
130+
// Not installed if no PanicHD migrations installed or choosen one is missing
125131
return (count($this->migrations_tables) == count($this->inactiveMigrations())
126132
|| in_array('2017_12_25_222719_update_panichd_priorities_add_magnitude', $this->inactiveMigrations()) ) ? false : true;
127133
}
@@ -187,7 +193,9 @@ public function setup(Request $request)
187193
}
188194

189195
$admin->save();
190-
196+
197+
\Cache::forget('panichd::installation');
198+
191199
return redirect()->route('panichd.install.index')->with('current_status', 'installed');
192200
}
193201

0 commit comments

Comments
 (0)