Fix possible error on update page
This commit is contained in:
parent
69de61aedd
commit
9197b8b095
3
resources/misc/changelogs/en/4.1.2.md
Normal file
3
resources/misc/changelogs/en/4.1.2.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
## Fixed
|
||||
|
||||
- Fixed possible error on update page.
|
||||
3
resources/misc/changelogs/zh_CN/4.1.2.md
Normal file
3
resources/misc/changelogs/zh_CN/4.1.2.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
## 修复
|
||||
|
||||
- 修复升级页面可能的出错
|
||||
|
|
@ -8,10 +8,9 @@
|
|||
|
||||
<p>{!! nl2br(trans('setup.updates.welcome.text', ['version' => config('app.version')])) !!}</p>
|
||||
|
||||
<form method="post" action="{{ url('/setup/update') }}" novalidate="novalidate">
|
||||
@csrf
|
||||
<p class="step">
|
||||
<input type="submit" name="submit" class="button button-large" value="@lang('setup.updates.welcome.button')" />
|
||||
</p>
|
||||
</form>
|
||||
<p class="step">
|
||||
<a href="{{ url('/setup/exec-update') }}" class="button button-large">
|
||||
@lang('setup.updates.welcome.button')
|
||||
</a>
|
||||
</p>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@ Route::group(['middleware' => 'setup'], function () {
|
|||
Route::post('/finish', 'SetupController@finish');
|
||||
});
|
||||
|
||||
Route::get('/update', 'SetupController@update');
|
||||
Route::post('/update', 'SetupController@doUpdate');
|
||||
Route::any('/update', 'SetupController@update');
|
||||
Route::any('/exec-update', 'SetupController@doUpdate');
|
||||
Route::view('/changelog', 'setup.updates.changelog');
|
||||
|
|
|
|||
|
|
@ -221,13 +221,13 @@ class SetupControllerTest extends TestCase
|
|||
); // Just a fixture
|
||||
|
||||
config(['options.new_option' => 'value']);
|
||||
$this->post('/setup/update')->assertViewHas('tips');
|
||||
$this->get('/setup/exec-update')->assertViewHas('tips');
|
||||
$this->assertEquals('value', option('new_option'));
|
||||
$this->assertEquals('100.0.0', option('version'));
|
||||
unlink(database_path("update_scripts/update-$current_version-to-100.0.0.php"));
|
||||
|
||||
option(['version' => '3.0.0']); // Fake old version
|
||||
$this->post('/setup/update');
|
||||
$this->get('/setup/exec-update');
|
||||
$this->assertEquals('100.0.0', option('version'));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user