Centreon 22.04.1: Display bug in Firefox on "Services by HostGroup" page
dsisysteme opened this issue · 4 comments
BUG REPORT INFORMATION
Prerequisites
The "Services by HostGroup" page accessible via the path "Monitoring > Status details > Services by HostGroup" is no longer displayed correctly in Firefox since we migrated to Centreon 22.04.
Versions
The Problem is observed on Centreon 22.04.1
Operating System
Centreon server is on CentOS 7.9.2009
Tests are performed from different navigators on different OS : Debian, Linux Mint, Ubuntu, Windows...
Browser used
- Google Chrome
- Firefox
- MS Edge
- Internet Explorer IE11
- Safari
Versions: 91.11.0esr(64bits), 95.0(64bits), 95.0.2(64bits), 103.0.1(64bits)...
The bug does not occur with Chromium (Chrome) and MS Edge web browsers
Description
This display bug occurs since we migrated from Centreon 21.04 to Centreon 22.04.
We noticed this bug only on Firefox browser and it does not occur on other browsers such as Chrome and Edge
Steps to Reproduce
- Log in Centreon with Firefox
- Go to the "Services by Hostgroup" page ("Monitoring > Status details > Services by HostGroup" )
- You can seen the display bug
Describe the received result
We have the following display repeated on several lines:
<span style='fill:var(--icons-fill-color) ; vertical-align: middle'><svg height='18' width='18' xmlns='http://www.w3.org/2000/svg' height='18px' viewBox='0 0 24 16' width='18px'><path d='M0 0h24v24H0V0z' fill='none'/><path d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/></svg></span>](https://supervision-test.univ-lille.fr/centreon/monitoring/resources?filter=%7B%22criterias%22%3A%7B%22search%22%3A%22h.name%3A%5Eadesrv-1-test.univ-lille.fr%24%22%7D%7D)[<span style='fill:var(--icons-fill-color) ; vertical-align: middle'><svg height='18' width='18' xmlns='http://www.w3.org/2000/svg' height='18px' viewBox='0 0 24 16' width='18px'><path d='M0 0h24v24H0V0z' fill='none'/><path d='M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z'/></svg></span>](https://supervision-test.univ-lille.fr/centreon/main.php?p=204&mode=0&svc_id=adesrv-1-test.univ-lille.fr)
Describe the expected result
We should have the display of a magnifying glass icon instead of the above code.
Logs
PHP error logs
Using PHP 8 on CentOS 7.9.2009
The logs don't seem to be related to this problem but we only have the following logs:
tail -f /var/log/php-fpm/centreon-error.log
[04-Aug-2022 11:02:26 Europe/Paris] PHP Warning: Trying to access array offset on value of type bool in /usr/share/centreon/www/main.get.php on line 149
[04-Aug-2022 11:02:26 Europe/Paris] PHP Warning: Trying to access array offset on value of type bool in /usr/share/centreon/www/main.get.php on line 151
[04-Aug-2022 11:03:25 Europe/Paris] PHP Warning: Trying to access array offset on value of type bool in /usr/share/centreon/www/main.get.php on line 146
[04-Aug-2022 11:03:25 Europe/Paris] PHP Warning: Undefined array key 1 in /usr/share/centreon/www/main.get.php on line 147
[04-Aug-2022 11:03:25 Europe/Paris] PHP Warning: Trying to access array offset on value of type bool in /usr/share/centreon/www/main.get.php on line 149
[04-Aug-2022 11:03:25 Europe/Paris] PHP Warning: Trying to access array offset on value of type bool in /usr/share/centreon/www/main.get.php on line 151
[04-Aug-2022 14:41:22 Europe/Paris] PHP Warning: Trying to access array offset on value of type bool in /usr/share/centreon/www/main.get.php on line 146
[04-Aug-2022 14:41:22 Europe/Paris] PHP Warning: Undefined array key 1 in /usr/share/centreon/www/main.get.php on line 147
[04-Aug-2022 14:41:22 Europe/Paris] PHP Warning: Trying to access array offset on value of type bool in /usr/share/centreon/www/main.get.php on line 149
[04-Aug-2022 14:41:22 Europe/Paris] PHP Warning: Trying to access array offset on value of type bool in /usr/share/centreon/www/main.get.php on line 151
Additional relevant information (e.g. frequency, ...)
This issue occurs constantly in Firefox.
It does not occur on other browsers.
This page is rendering with XML data and XSL transformations (applied by the browser):
- a field contains an icon in SVG : it's composed of XML tags (like HTML)
- the XSL transformation use this data with an option "disable-output-escaping"
- but Firefox don't accept this option so the SVG is escaped and we see his code
Corresponding code:
- www/include/monitoring/status/ServicesHostGroups/xml/serviceGridByHGXML.php
(lines 324 & 328 with the "returnSvg" function call) - www/include/monitoring/status/ServicesHostGroups/xsl/serviceGridByHG.xsl
(lines 90 & 94 with the "xsl:value-of" transformation)
Mozilla reference: https://bugzilla.mozilla.org/show_bug.cgi?id=98168
I think it's better to remove the SVG from the XML (just a text, or maybe a path to the icon).
Maybe my PR is not the right way to resolve this, because a solution seems to already exists with a <span class="svgs">...</span>
around the SVG code.
Then the right fix should be to continue this wrapping for all the SVG icons in the XSL files...
Already fixed with #11659
Thank you @proxyconcept for your answer.
According to #11659 the patch is intended for 22.10.x version.
We have now to wait for the release of this version.