Visual Query Icon disappeared after Upgrade to 13.0.2

Hi,

The visual query is working good but the FA icon in the menu got disappeared and the html code is shown in the menu. Please see below

image

Is there any way to get back the FA icon…? Thank you in advance.

@ksar, @eldy, @eldy2 and @ all helping hearts

Dear all,

Visual Query is a free database management tool available in dolistore at:

https://www.dolistore.com/en/modules/1086-Visual-Query.html?search_query=visual+query&results=30

This seem to be written by one: AXel (mailto:contact.axel.dev@gmail.com)
Git hub : AXeL-dev (AXeL) · GitHub

The issue is when you install this product in dolibarr 12 the menu icon is fine and upgrade to dolibarr 13.0.2, it disappears and looks like the above picture given in earlier post.

I did some research to userstand:

  1. AXel used lang file in /htdocs/custom/visualquery/langs/en_US/visualquery.lang and defined the FA icon as

image

  1. This is getting mapped to titre variable in dolibarr.

  2. The file /htdocs/core/menus/standard/eldy.lib.php uses this entry in line no 2000.

print ($menu_array[$i][‘prefix’] ? $menu_array[$i][‘prefix’] : ‘’).$menu_array[$i][‘titre’];

  1. Since the string is passing through a function : dol_string_no_html_tag(), the value of VisualQueryWithIcon is getting stripped and results in non recognition of FA icon.

  2. Since $newmenu->add(…) function is used for other menu items like Users & Groups, where it is hard coded, I am unable to understand how to make the FA icon to be displayed.

see below graphics:

image

If we correct it in browser inspect, then the icon gets displayed well…

image

Any help how to resolve this issue please…?

Thanks and Regards,
YesBee…

Hi,

The first thing is to contact the developer of that module, have you done it ?

Hi Ksar,

Thank you for guidance.

Yes, I have done that on few times through email mentioned in the dolistore. But no luck and given up.

So, thought this learned forum may help since the issue seem to be handling the html code within Module name string which should be common to those who use FA icons along with their module name…

Interestingly this was working fine in Dolibarr 12

thanks,
yesbee.

Dear ksar,

Got an idea how to display font awesome icons in the menu from dolibarr 13.0.2. Unlike 12.0.4, it is 2000 line in eldy.lib.php does the magic:

print ($menu_array[$i][‘prefix’] ? $menu_array[$i][‘prefix’] : ‘’).$menu_array[$i][‘titre’];

if the $menu_array[$i][‘prefix’] = lt i class="fa fa-database fa-fw paddingright"gt lt /i gt then the fontawesome icon is shown in Dolibarr 13.0.2

So, in order to set the value in the menu array, I need your help please…

Kindly refer the below taken from the link:

// Example to declare a Left Menu entry:
$this->menu[$r]=array( ‘fk_menu’=>‘fk_mainmenu=xxx’, // Use ‘fk_mainmenu=xxx’ or ‘fk_mainmenu=xxx,fk_leftmenu=yyy’ where xxx is mainmenucode and yyy is a leftmenucode of parent menu
‘type’=>‘left’, // This is a Left menu entry
‘titre’=>‘MyModule left menu 1’,
‘mainmenu’=>‘xxx’,
‘leftmenu’=>‘yyy’,
‘url’=>‘/mymodule/pagelevel1.php’,
‘langs’=>‘mylangfile’, // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
‘position’=>100,
‘enabled’=>‘1’, // Define condition to show or hide menu entry. Use ‘$conf->mymodule->enabled’ if entry must be visible if module is enabled.
‘perms’=>‘1’, // Use ‘perms’=>‘$user->rights->mymodule->level1->level2’ if you want your menu with a permission rules
‘target’=>‘’,
‘user’=>2); // 0=Menu for internal users,1=external users, 2=both
$r++;

Can you kindly please help me to understand what parameter to be added in the above to add a font awesome icon (like lt;i gt; “fa fa-database fa-fw paddingright” gt lt /i gt)

or

Please refer to link:

where caos30 has replied for main menu. Will that fit my case for side menu as well…?

enu is left menu, module is visualquery and the unicode of icon is f1c0.

Please guide.

Thanks and Regards,
yesbee

Hello @RiseValInfotech i have downloaded this module now and checked this problem on menu. You’re right… and i solved in this way:

  1. Edit file /htdocs/custom/visualquery/langs/en_US/visualquery.lang
  2. Replace this line:
VisualQueryWithIcon = <i class="fa fa-database fa-fw paddingright"></i>Visual Query

with this other:

VisualQueryWithIcon = <i></i> Visual Query
  1. Then edit the CSS file of your dolibarr theme and at the end add this:
.vmenu[title='Visual Query'] i{
	margin-left: 4px;
	font-weight: 900;
	font-family: "Font Awesome 5 Free";
	display: inline-block;
	font-style: normal;
	font-variant: normal;
	text-rendering: auto;
	line-height: 1;
}
.vmenu[title='Visual Query'] i::before{content:"\f1c0"}

And voilà! this worked for me. It really is not the optimal solution, but it works. It seems that the problem is that Dolibarr run an “odd” striptags() command over the defined title for the menu item, which curiously accept an HTML tag WHENEVER it has not attributes. So it accepts <i> but not <i clas="..."></i>. So, the solution is to define a title using only <i></i> and then use CSS to add the icon, just like usually we get using class="fa fa-database" :wink:

Cheers!
Sergi

Dear Sergi,

Thanks a ton for the solution and yes voila, it works !

I added the CSS code in global.inc.php and FA Icon appears in the Left menu. There is a custom css folder inside htdocs/custom/visualquery/css. Tried creating a visualquery.css there and added the code, interestingly, it didnot work…

Any pointer why the custom CSS is not considered by dolibarr in this case please…

Again thank you for the help, it is important guidance in my journey exploring dolibarr and customizations to it.

Thanks and Regards,
Satheesh.

Dear @RiseValInfotech i feel happy to be useful. Thanks for your kindly comment.

Indeed, i’ve a Dark Theme for Dolibarr (7-13.x) on Dolistore by only 6 EUR :slight_smile:

https://www.dolistore.com/en/skins/1365-Dark-theme-IMASDEWEB-13.html

I like a lot to work on CSS, so for me always is interesting solve CSS issues like yours with icon :grin:
And i needed to develop my dark theme 2 years ago because my eyes couldn’t see shinny/white usual screens… But certainly i think that it got beautiful, hehehe.
Cheers!

Dear Sergi @caos30

Can you please share your email or Skype id please.

thanks
Satheesh