View Issue Details

IDProjectCategoryView StatusLast Update
0030773mantisbtperformancepublic2023-10-31 16:32
Reporterdregad Assigned Todregad  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Target Version2.26.0Fixed in Version2.26.0 
Summary0030773: Only load dynamic CSS status_config.php when necessary
Description

The dynamic CSS for status colors is systematically included on all MantisBT pages, even when the styles it defines are not used.

This is because of an unconditional require_css( 'status_config.php' ); call in relationship_api.php and bug_group_action_api.php.

To avoid unnecessarily load of the stylesheet, the require_css() call should be moved to the individual files that do require the specific color classes.

Additional Information

NOTE: This change could introduce regression issues for Plugins relying on the status_config.php CSS to be loaded by MantisBT core.

  • Affected plugins: relying on html_get_statuscss* functions
  • Symptoms: The status indicators are displayed in black instead of the expected color
  • Solution: add require_css( 'status_config.php' ); to the relevant plugin pages or in the EVENT_LAYOUT_RESOURCES hook, as appropriate.

The Source Integration plugin <= 2.5.2 is affected (View Changeset page).

TagsNo tags attached.

Activities

atrol

atrol

2022-07-30 11:09

developer   ~0066839

Missed some pages PR https://github.com/mantisbt/mantisbt/pull/1835

dregad

dregad

2022-07-30 11:45

developer   ~0066843

Thanks Roland.

Related Changesets

MantisBT: master e296eb4a

2022-07-11 02:18

dregad


Details Diff
Only load status_config.php CSS when necessary

The dynamic CSS for status colors was included in relationship_api.php
and bug_group_action_api.php, which caused status_config.php to be
loaded for every MantisBT page even though it is not needed for many of
them.

This moves the require_css() call to the individual files that require
the specific color classes.

NOTE: This could introduce regression issues for Plugins relying on the
status_config.php CSS to be loaded by MantisBT core.
- Affected plugins: relying on html_get_status_css_* functions
- Symptoms: The status indicators are displayed in black instead of the
expected color
- Solution: add `require_css( 'status_config.php' );` to the relevant
plugin pages or in the EVENT_LAYOUT_RESOURCES hook, as appropriate.

Fixes 0030773
Affected Issues
0030773
mod - bug_actiongroup.php Diff File
mod - bug_actiongroup_ext.php Diff File
mod - bug_actiongroup_ext_page.php Diff File
mod - bug_actiongroup_page.php Diff File
mod - changelog_page.php Diff File
mod - core/bug_group_action_api.php Diff File
mod - core/relationship_api.php Diff File
mod - print_all_bug_page.php Diff File
mod - roadmap_page.php Diff File

MantisBT: master aed33fbc

2022-07-20 11:51

dregad


Details Diff
Remove unneeded code in status_config.php

The logic to load the dynamic CSS only for certain pages based on
HTTP_REFERER is no longer needed, as the script is only called when it
is actually needed

Issue 0030773

Signed-off-by: Damien Regad <dregad@mantisbt.org>
Affected Issues
0030773
mod - css/status_config.php Diff File

MantisBT: master 8777e43f

2022-07-30 11:03

atrol


Details Diff
Add missing pages where dynamic CSS is not loaded

Issue 0030773
Affected Issues
0030773
mod - bug_change_status_page.php Diff File
mod - bug_reminder_page.php Diff File