Dependency Graph
View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0035552 | mantisbt | ui | public | 2025-03-08 07:57 | 2025-03-22 00:36 |
Reporter | dregad | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | sometimes |
Status | resolved | Resolution | fixed | ||
Target Version | 2.28.0 | Fixed in Version | 2.28.0 | ||
Summary | 0035552: Inline error messages are sometimes displayed behind the navbar | ||||
Description | This causes the first such warning to be impossible to read without using the browser's developer tools. @raspopov proposed a fix for this in PR 2115 which displays the div with a relative position shifted down, but the solution has a negative side-effect as it also shifts the warnings when they are occurring later on the page (see screenshot). 3 alternatives are discussed in the PR
| ||||
Tags | No tags attached. | ||||
Attached Files | |||||
I don't much like this idea to be honest.
The purpose of these inline warnings is to help catching minor issues such as deprecation notices during development. The idea is to have them printed visually close to where they are triggered. Of course this is somewhat unnecessary, because we also have the line number printed with the message, but I kind of like it. If we always set the constant to true, then we lose this. But then we don't need the conditional display in error_handler() anymore as they would always be delayed.
The DELAY_INLINE_ERROR_REPORTING constant was introduced in PR 2066 to fix 0035207, which is basically the same issue / root cause as this, but the fix only covered a few use cases (e.g. plugin initialisation). We could probably adapt and generalize the existing mechanism to achieve that - instead of calling error_delay_reporting() when we (think we) need it, do it systematically as part of layout API. |
|
How about doing both? Print both inline and pending messages? (perhaps with an indication that it's a duplicate). |
|
What is the added value of printing the same error twice ? |
|
Draft PR: https://github.com/mantisbt/mantisbt/pull/2120 At this point, the PR is just a cherry-pick of @raspopov's proposed fix. |
|
I decided to replace the DELAY_INLINE_ERROR_REPORTING constant by a global variable, to give more flexibility as to when inline warnings should be delayed or not. PR https://github.com/mantisbt/mantisbt/pull/2120 updated and ready for review. Testing and feedback is welcome. |
|
MantisBT: master 9dfb34b9 2025-03-15 10:32 Details Diff |
Fix inline warnings showing behind navbar Improves the delayed printing mechanism implemented in 0035207, replacing the DELAY_INLINE_ERROR_REPORTING constant by a global variable ($g_errors_delay_reporting), allowing to switch delayed reporting on and off as needed. Reporting is delayed by default, and Layout API (layout_page_begin()) switches it off when the page header has been displayed. Fixes 0035552 |
Affected Issues 0035552 |
|
mod - core/error_api.php | Diff File | ||
mod - core/layout_api.php | Diff File | ||
MantisBT: master 8dd060a2 2025-03-16 05:18 Details Diff |
Display errors triggered after delayed printing When delayed reporting is on, an inline error triggered after delayed errors have been printed will not be displayed. To avoid that, set $g_error_delay_reporting = false at the end of error_print_delayed(). Fixes 0035552 |
Affected Issues 0035552 |
|
mod - core/error_api.php | Diff File |