When setting show_header to false in any view with subpanels it throws javascript errors #8400
Labels
Status:Fix Proposed
A issue that has a PR related to it that provides a possible resolution
Type: Bug
Bugs within the core SuiteCRM codebase
Setting
show_header
option to false in any view avoids rendering some specific javascript files and lines.Particulary when using subpanels in the view, the definitions of js variables
UA
(which is in _head.tpl) andSUGAR.measurements
(in style.js) are missing.These are used in SubPanelTiles.js and SubPanelTiles.tpl with no previous checking on their value. This throws javascript errors which end up stopping further execution.
Issue
There are two errors but the origin is the same (not rendering the javascript header).
SubPanelTiles.tpl tries to use the js variables
SUGAR.measurements
and SubPanelTiles.js tries to use js variableUA
without checking if these are defined. When they are not defined it throws js errors. See below:UA
is used inSUGAR.util.evalScript
which is used bygot_data
function in SubPanelTiles.js when subpanel data is loaded.Expected Behavior
In a view with subpanels and
show_headers
set to false no js errors should be thrown.Actual Behavior
In a view with subpanels and
show_headers
set to false two js errors are thrown.Possible Fix
I see two possible solutions:
show_header
set to false.UA
).Steps to Reproduce
Context
When adding some custom js to execute after the subpanel data is fetched and shown, these js errors crash js execution and custom js fails to load.
Your Environment
The text was updated successfully, but these errors were encountered: