View Issue Details

IDProjectCategoryView StatusLast Update
0028618mantisbtbugtrackerpublic2023-01-06 11:13
Reporterfjacquet@grizzlydev.com Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
OSWindowsOS Version10 
Product Version2.24.4 
Target Version2.26.0Fixed in Version2.26.0 
Summary0028618: Category empty but required does not prevent form submission on Firefox Windows and Safari
Description

On the "Enter Issue Details" form, the "Category" select input is a required field. As such it has a required HTML5 attribute which prevents form submission when no option was selected.

However, when using Firefox on Windows and Safari browsers, the form can be submitted with no category selected resulting in an error telling the user he can go back using the browser "Back" button. But in this case, the form content is lost...

The bug is due to the "empty" / "select" option having a value="0". The value should be value="" instead.

The fix is the following:
line 769 in file core/print_api.php:
<pre>
// GZ FJ fix required Category select in Firefox Windows.
// echo '<option value="0" disabled hidden';
echo '<option value=""';
</pre>

Related issue: https://mantisbt.org/bugs/view.php?id=26686

Steps To Reproduce

Use Firefox on Windows and Safari browsers and do not select a "Category".

TagsNo tags attached.

Relationships

related to 0026686 closeddregad Make category on bug_report_page a required field when $g_allow_no_category = OFF; 
has duplicate 0026152 resolvedatrol submitting new issue: inconsequent handling of unfilled fields 
has duplicate 0031881 closedatrol Anomaly report: Category field 
related to 0029689 closedatrol Summary field is lost when pressing back button after hitting an error when reporting an issue 

Activities

Related Changesets

MantisBT: master 407d0fd9

2021-05-24 08:53

dregad


Details Diff
Let browser handle required category field

Proper empty default value on SELECT, lets the browser catch the error
without actually submitting the form.

Fixes 0028618
Affected Issues
0028618
mod - core/print_api.php Diff File