Skip to content

Commit f804c6f

Browse files
committed
BUG: Ticket routes now require the right parameter name
1 parent aa12850 commit f804c6f

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/Views/tickets/show/modal_complete.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</div>
6363
<div class="modal-footer">
6464
@if ($u->currentLevel() > 1)
65-
<a id="edit-with-values" class="btn btn-default mr-auto" href="{{ route($setting->grab('main_route').'.edit', ['id' => $ticket->id]) . '/complete/yes/status_id/' . $setting->grab('default_close_status_id') }}">{{ trans('panichd::lang.show-ticket-modal-edit-fields') }}</a>
65+
<a id="edit-with-values" class="btn btn-default mr-auto" href="{{ route($setting->grab('main_route').'.edit', ['ticket' => $ticket->id]) . '/complete/yes/status_id/' . $setting->grab('default_close_status_id') }}">{{ trans('panichd::lang.show-ticket-modal-edit-fields') }}</a>
6666
@endif
6767
<button type="button" id="complete_form_submit" class="btn btn-danger">{{ trans('panichd::lang.btn-mark-complete') }}</button>
6868
</div>

src/Views/tickets/show/scripts.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
9797
// Complete modal status_id change
9898
$('#ticket-complete-modal #status_id').change(function(){
99-
var url = '{{ route($setting->grab('main_route').'.edit', ['id' => $ticket->id]) . '/complete/yes/status_id/' }}';
99+
var url = '{{ route($setting->grab('main_route').'.edit', ['ticket' => $ticket->id]) . '/complete/yes/status_id/' }}';
100100
$('#ticket-complete-modal #edit-with-values')
101101
.prop('href', url + $(this).val());
102102
});

tests/TicketsTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ public function testTicketShowEdit()
9595
// Visible ticket
9696
$ticket = clone $this->member_tickets_builder;
9797
$ticket = $ticket->notHidden()->first();
98-
$response = $this->actingAs($this->member)->get(route($this->main_route . '.show', ['id' => $ticket->id]));
98+
$response = $this->actingAs($this->member)->get(route($this->main_route . '.show', ['ticket' => $ticket->id]));
9999
$this->versionAssertStatus($response, 200);
100100
/*
101101
// TODO: Ensure to generate a fake user that doesn't have edit permissions on the aimed ticket
102-
$response = $this->actingAs($this->member)->get(route($this->main_route . '.edit', ['id' => $ticket->id]));
102+
$response = $this->actingAs($this->member)->get(route($this->main_route . '.edit', ['ticket' => $ticket->id]));
103103
$this->versionAssertStatus($response, 302);*/
104104

105105
// Hidden ticket without $this->member in notifications
@@ -111,9 +111,9 @@ public function testTicketShowEdit()
111111
})
112112
->first();
113113
if(!is_null($ticket)){
114-
$response = $this->actingAs($this->member)->get(route($this->main_route . '.show', ['id' => $ticket->id]));
114+
$response = $this->actingAs($this->member)->get(route($this->main_route . '.show', ['ticket' => $ticket->id]));
115115
$this->versionAssertStatus($response, 302);
116-
$response = $this->actingAs($this->member)->get(route($this->main_route . '.edit', ['id' => $ticket->id]));
116+
$response = $this->actingAs($this->member)->get(route($this->main_route . '.edit', ['ticket' => $ticket->id]));
117117
$this->versionAssertStatus($response, 302);
118118
}
119119
}
@@ -122,9 +122,9 @@ public function testTicketShowEdit()
122122
if(!is_null($this->agent)){
123123
$ticket = $this->agent->agentTickets()->inRandomOrder()->first();
124124

125-
$response = $this->actingAs($this->agent)->get(route($this->main_route . '.show', ['id' => $ticket->id]));
125+
$response = $this->actingAs($this->agent)->get(route($this->main_route . '.show', ['ticket' => $ticket->id]));
126126
$this->versionAssertStatus($response, 200);
127-
$response = $this->actingAs($this->agent)->get(route($this->main_route . '.edit', ['id' => $ticket->id]));
127+
$response = $this->actingAs($this->agent)->get(route($this->main_route . '.edit', ['ticket' => $ticket->id]));
128128
$this->versionAssertStatus($response, 200);
129129
}
130130

@@ -137,9 +137,9 @@ public function testTicketShowEdit()
137137
$ticket = $build->newest()->first();
138138

139139
if (!is_null($ticket)){
140-
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.show', ['id' => $ticket->id]));
140+
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.show', ['ticket' => $ticket->id]));
141141
$this->versionAssertStatus($response, 200);
142-
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.edit', ['id' => $ticket->id]));
142+
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.edit', ['ticket' => $ticket->id]));
143143
$this->versionAssertStatus($response, 200);
144144
}
145145

@@ -148,9 +148,9 @@ public function testTicketShowEdit()
148148
$ticket = $build->active()->first();
149149

150150
if (!is_null($ticket)){
151-
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.show', ['id' => $ticket->id]));
151+
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.show', ['ticket' => $ticket->id]));
152152
$this->versionAssertStatus($response, 200);
153-
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.edit', ['id' => $ticket->id]));
153+
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.edit', ['ticket' => $ticket->id]));
154154
$this->versionAssertStatus($response, 200);
155155
}
156156

@@ -159,9 +159,9 @@ public function testTicketShowEdit()
159159
$ticket = $build->complete()->first();
160160

161161
if (!is_null($ticket)){
162-
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.show', ['id' => $ticket->id]));
162+
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.show', ['ticket' => $ticket->id]));
163163
$this->versionAssertStatus($response, 200);
164-
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.edit', ['id' => $ticket->id]));
164+
$response = $this->actingAs($this->admin)->get(route($this->main_route . '.edit', ['ticket' => $ticket->id]));
165165
$this->versionAssertStatus($response, 200);
166166
}
167167
}

0 commit comments

Comments
 (0)