View Issue Details

IDProjectCategoryView StatusLast Update
0016011mantisbtcustom fieldspublic2019-09-17 08:07
Reportermneute Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Summary0016011: Readonly custom fields and default value
Description

A custom enumeration field with a default value is working correctly when the user can edit it.
But if the user cannot edit that field, it just appears empty, and not with the default value.

TagsNo tags attached.

Relationships

related to 0026151 new Custom fields required but not displayed should be filled with the default value 

Activities

AnvilStriker

AnvilStriker

2016-04-08 09:19

reporter   ~0052920

See https://www.mantisbt.org/forums/viewtopic.php?f=2&t=23750 for an analysis of this behavior as it manifests when reporting a bug. I have not yet performed a similar analysis for other phases of the bug lifecycle.

In short, the problem is that if the user does not have read/write access to the custom field, the code that populates the bug report page with custom fields simply skips it rather than creating an HTML control with its "disabled" attribute set. See: https://github.com/mantisbt/mantisbt/blob/f67ec45972ada6ef3cf3b727b41ce1afb967ff6c/bug_report_page.php#L566

This not only prevents the field from being displayed, but also prevents it from being initialized to its specified default value when the form is submitted. This particular problem is compounded by the code at https://github.com/mantisbt/mantisbt/blob/f67ec45972ada6ef3cf3b727b41ce1afb967ff6c/bug_report.php#L218 which skips any value submitted for the field, rather than setting it to its specified default value.

stevecharon

stevecharon

2019-03-20 05:00

reporter   ~0061720

We have the same issue here with custom fields are not initally populated.
I see population of that field if reporter has write access to the custom_field.
But the point is that by defining a default value, the system should populate it nonetheless.
It could be even set internally if the user does not get it displayed due to insufficient rights.
In the current case we have a custom field with enumeration that is set to enhance our workflow.
It is set initally to filter for unevaluated entries and has several levels to determine when it is to be implemented (if not it is getting closed).
So having it empty it is not filterable.

10penny

10penny

2019-07-26 13:03

reporter   ~0062429

+1 on this being an issue that's impacted our desired workflow setup. We're currently working around it by just having to expose the fields to more users than we wanted and documenting how they're supposed to be used but it's pretty frustrating

Issue History

Date Modified Username Field Change
2013-06-05 05:19 mneute New Issue
2013-06-05 07:45 atrol Category customization => custom fields
2016-04-08 09:19 AnvilStriker Note Added: 0052920
2019-03-20 05:00 stevecharon Note Added: 0061720
2019-07-26 13:03 10penny Note Added: 0062429
2019-09-17 08:07 dregad Relationship added related to 0026151