Cleanup the Fix
This commit is contained in:
parent
8140ebd1cc
commit
3c0cbe55b6
|
@ -91,11 +91,7 @@ class ImportSchedule extends BaseController
|
|||
public function edit(Request $request): Response
|
||||
{
|
||||
$scheduleId = $request->getAttribute('schedule_id'); // optional
|
||||
|
||||
$schedule = ScheduleUrl::find($scheduleId);
|
||||
if ($schedule == null) {
|
||||
$schedule = new ScheduleUrl();
|
||||
}
|
||||
|
||||
return $this->response->withView(
|
||||
'admin/schedule/edit.twig',
|
||||
|
|
|
@ -64,7 +64,11 @@
|
|||
<div class="row">
|
||||
{% for id,name in locations %}
|
||||
<div class="col-md-3">
|
||||
{{ f.checkbox('location_' ~ id, name, {'checked': id in schedule.activeLocations.pluck('id')}) }}
|
||||
{{ f.checkbox(
|
||||
'location_' ~ id,
|
||||
name,
|
||||
{'checked': schedule and id in schedule.activeLocations.pluck('id')}
|
||||
) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue