View Issue Details

IDProjectCategoryView StatusLast Update
0028618mantisbtbugtrackerpublic2023-10-14 12:28
Reporterfjacquet@grizzlydev.com Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
OSWindowsOS Version10 
Product Version2.24.4 
Target Version2.25.8Fixed in Version2.25.8 
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 closedatrol submitting new issue: inconsequent handling of unfilled fields 
has duplicate 0031881 closedatrol Anomaly report: Category field 
has duplicate 0032789 closedatrol Detect empty fields before trying to post bug 
related to 0029689 closedatrol Summary field is lost when pressing back button after hitting an error when reporting an issue 

Activities

dregad

dregad

2021-05-24 12:55

developer   ~0065563

PR https://github.com/mantisbt/mantisbt/pull/1754

dregad

dregad

2023-07-28 08:55

developer   ~0067917

Considering how many times this issue has been reported, maybe the fix should be back-ported to 2.25 branch, @atrol what do you think ?

atrol

atrol

2023-07-28 11:09

developer   ~0067918

@dregad as this is a simple one-line change, I was thinking exactly about the same when dealing with 0032789.

dregad

dregad

2023-07-29 03:52

developer   ~0067919

Commit cherry-picked to master-2.25 branch, target and fixed in version updated.

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

MantisBT: master-2.25 9128d261

2021-05-24 12: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

(cherry picked from commit 407d0fd9b3deed770b25595822bf8c296637b199)
Affected Issues
0028618
mod - core/print_api.php Diff File