Skip to content

Commit f7f9235

Browse files
committed
Fix regression by changing 'selected' to 'checked'
1 parent 81e26f5 commit f7f9235

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/templates/Packet/Form.inc.phtml

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ use \CarlBennett\MVC\Libraries\Common; ?>
2929
</div><div class="col-lg-2">
3030
<div class="form-group">
3131
<label class="font-weight-bold">Options:</label>
32-
<div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="deprecated" name="deprecated" value="1"<?=($form_fields['deprecated'] ?? null ? ' selected' : '')?> tabindex="4"/><label class="custom-control-label text-danger" for="deprecated">Deprecated</label></div>
33-
<div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="research" name="research" value="1"<?=($form_fields['research'] ?? null ? ' selected' : '')?> tabindex="5"/> <label class="custom-control-label text-warning" for="research">In Research</label></div>
34-
<div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="published" name="published" value="1"<?=($form_fields['published'] ?? null ? ' selected' : '')?> tabindex="6"/> <label class="custom-control-label text-success" for="published">Published</label></div>
32+
<div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="deprecated" name="deprecated" value="1"<?=($form_fields['deprecated'] ?? null ? ' checked' : '')?> tabindex="4"/><label class="custom-control-label text-danger" for="deprecated">Deprecated</label></div>
33+
<div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="research" name="research" value="1"<?=($form_fields['research'] ?? null ? ' checked' : '')?> tabindex="5"/> <label class="custom-control-label text-warning" for="research">In Research</label></div>
34+
<div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="published" name="published" value="1"<?=($form_fields['published'] ?? null ? ' checked' : '')?> tabindex="6"/> <label class="custom-control-label text-success" for="published">Published</label></div>
3535
</div>
3636
</div>
3737
</div>
@@ -78,7 +78,7 @@ use \CarlBennett\MVC\Libraries\Common; ?>
7878
$p = $form_products[$p_i];
7979
$p_id = $p->getBnetProductId();
8080
$p_label = $p->getLabel();
81-
printf('<td><div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="used_by_%s" name="used_by[]" value="%s"%s/><label class="custom-control-label" for="used_by_%s">%s</label></div></td>', $p_id, $p_id, (in_array($p, $form_fields['used_by'] ?? []) ? ' selected' : ''), $p_id, $p_label);
81+
printf('<td><div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="used_by_%s" name="used_by[]" value="%s"%s/><label class="custom-control-label" for="used_by_%s">%s</label></div></td>', $p_id, $p_id, (in_array($p, $form_fields['used_by'] ?? []) ? ' checked' : ''), $p_id, $p_label);
8282
if ($p_i % 2 === 1) echo '</tr>';
8383
} ?>
8484
</tbody>
@@ -89,7 +89,7 @@ use \CarlBennett\MVC\Libraries\Common; ?>
8989
<span class="float-right">
9090
<div class="custom-control custom-switch">
9191
<input class="custom-control-input" type="checkbox" name="markdown" id="markdown" tabindex="5"
92-
title="Use markdown or use raw HTML" value="1"<?=($form_fields['markdown'] ?? null ? ' selected' : '')?>/>
92+
title="Use markdown or use raw HTML" value="1"<?=($form_fields['markdown'] ?? null ? ' checked' : '')?>/>
9393
<label class="custom-control-label" for="markdown" title="Use markdown or use raw HTML">Markdown</label>
9494
</div>
9595
</span>

0 commit comments

Comments
 (0)