View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0037391 | mantisbt | custom fields | public | 2026-09-16 09:24 | 2026-09-16 09:47 |
| Reporter | c_schmitz | Assigned To | |||
| Priority | normal | Severity | block | Reproducibility | always |
| Status | new | Resolution | open | ||
| Product Version | 2.28.4 | ||||
| Summary | 0037391: Editing/viewing a custom field can make an unrelated custom field "disappear" and break the page | ||||
| Description | MantisBT keeps a temporary lookup that maps custom field names to their IDs. If a page happens to load just one specific custom field first (for example, opening the "Edit Custom Field" page for a single field), that lookup gets partially filled in — but the system then wrongly assumes it's fully filled in. Any later attempt on that same page to find a different custom field by name will incorrectly report that it doesn't exist, even though it does. In practice, we saw this cause a real crash: our site has a plugin that looks up a custom field called "Bug heat" by name whenever an issue number is shown as a link (e.g. in "Recently Visited"). If that link is shown on a page that just loaded a different custom field first, the plugin gets told "Bug heat" doesn't exist, and the whole page fails with a fatal error instead of just showing the link. | ||||
| Steps To Reproduce | 1.) Have two or more custom fields set up (e.g. "Field A" and "Bug heat"), both linked to a project. Expected result: Looking up a custom field by name should always find it if it exists, no matter what else was looked up earlier on the same page. Actual result: The lookup returns "not found," and (with plugins like BugHeat that don't expect this) the page can crash with a fatal "Custom field not found" error. | ||||
| Additional Information | Where to look: custom_field_get_id_from_name() in core/custom_field_api.php — it only rebuilds its full name lookup when the cache is completely empty, rather than checking whether it was ever fully built. I will submit a PR and add the link here, later. | ||||
| Tags | No tags attached. | ||||