Skip to content

Commit

Permalink
Bugs fixed
Browse files Browse the repository at this point in the history
- 500 error on registering with a non-unique username
- Roll raffle group 500 error
- Breadcrumbs link on character profile pages link to main masterlist instead of MYO masterlist

Misc
- Character masterlist now orders by number descending rather than creation order, as approved MYO slots would be placed out of order in the list
  • Loading branch information
corowne committed May 10, 2020
1 parent aa7dd83 commit 3df4bec
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/RaffleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function getRollRaffleGroup($id)
*/
public function postRollRaffleGroup(RaffleManager $service, $id)
{
if ($service->rollRaffleGroup(Raffle::find($id))) {
if ($service->rollRaffleGroup(RaffleGroup::find($id))) {
flash('Winners rolled!')->success();
return redirect()->back();
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function showRegistrationForm()
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'min:3', 'max:25', 'alpha_dash'],
'name' => ['required', 'string', 'min:3', 'max:25', 'alpha_dash', 'unique:users'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'agreement' => ['required', 'accepted'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
Expand Down
8 changes: 7 additions & 1 deletion app/Http/Controllers/BrowseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ public function getCharacters(Request $request)
$query->whereIn('id', $imageQuery->pluck('character_id')->toArray());

switch($request->get('sort')) {
case 'number_desc':
$query->orderBy('characters.number', 'DESC');
break;
case 'number_asc':
$query->orderBy('characters.number', 'ASC');
break;
case 'id_desc':
$query->orderBy('characters.id', 'DESC');
break;
Expand All @@ -171,7 +177,7 @@ public function getCharacters(Request $request)
$query->orderBy('characters.sale_value', 'ASC');
break;
default:
$query->orderBy('characters.id', 'DESC');
$query->orderBy('characters.number', 'DESC');
}

return view('browse.masterlist', [
Expand Down
2 changes: 1 addition & 1 deletion resources/views/browse/_masterlist_content.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<div class="form-inline justify-content-end mb-3">
<div class="form-group mr-3">
{!! Form::label('sort', 'Sort: ', ['class' => 'mr-2']) !!}
{!! Form::select('sort', ['id_desc' => 'Newest First', 'id_asc' => 'Oldest First', 'sale_value_desc' => 'Highest Sale Value', 'sale_value_asc' => 'Lowest Sale Value'], Request::get('sort'), ['class' => 'form-control']) !!}
{!! Form::select('sort', ['number_desc' => 'Number Descending', 'number_asc' => 'Number Ascending', 'id_desc' => 'Newest First', 'id_asc' => 'Oldest First', 'sale_value_desc' => 'Highest Sale Value', 'sale_value_asc' => 'Lowest Sale Value'], Request::get('sort'), ['class' => 'form-control']) !!}
</div>
{!! Form::submit('Search', ['class' => 'btn btn-primary']) !!}
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/character/myo/character.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@section('profile-title') {{ $character->fullName }} @endsection

@section('profile-content')
{!! breadcrumbs(['Masterlist' => 'masterlist', $character->fullName => $character->url]) !!}
{!! breadcrumbs(['MYO Slot Masterlist' => 'myos', $character->fullName => $character->url]) !!}

@include('character._header', ['character' => $character])

Expand Down

0 comments on commit 3df4bec

Please sign in to comment.