Jump to content

Graph caption doesn't support unicode letters


Blesta Addons

Recommended Posts

6 hours ago, Paul said:

I wonder if this is an issue with the NVD3 library. Do you have the same issue if you download the library and edit one of the examples? http://nvd3.org/

is working normal when we make a manual example.

what i have arrived to make it work, with this small change

"key":"<?php $this->Html->_($data['name']);?>",

to

"key":"<?php echo $this->Html->ifSet($data['name']);?>",

 

Link to comment
Share on other sites

  • 2 months later...

I have the same issue, i have aplied your patch and is working, after the upgrade it return to show ascii char. I need to patch the file again .

This small fixes/patch should be added in the new release. I even not seeing any task for it, if it was a issue with a simple latin letter  it was fixed !!!

To be multilanguage you should take care of all languages chars , The world is not only latin letters !!!!!

Link to comment
Share on other sites

On 6/13/2017 at 5:28 PM, Blesta Addons said:

is working normal when we make a manual example.

what i have arrived to make it work, with this small change


"key":"<?php $this->Html->_($data['name']);?>",

to


"key":"<?php echo $this->Html->ifSet($data['name']);?>",

 

Which file is this in?

Link to comment
Share on other sites

11 hours ago, evolvewh said:

This seems to be working better so far:

https://github.com/novus/nvd3/releases/tag/v1.8.6

the Issue in not related to the nvd3, is a Blesta issue, the Html->_() call the safe() function that is stripe the HTML utf-8 chars instead of the ifSet() function that return the string as is it .

the patch is for the file plugins/billing_overview/views/default/admin_main_overview.pdt in the line 126 .

@Paul can you confirm this ?

Link to comment
Share on other sites

On 9/9/2017 at 8:11 AM, Blesta Addons said:

the Issue in not related to the nvd3, is a Blesta issue, the Html->_() call the safe() function that is stripe the HTML utf-8 chars instead of the ifSet() function that return the string as is it .

the patch is for the file plugins/billing_overview/views/default/admin_main_overview.pdt in the line 126 .

@Paul can you confirm this ?

Thanks for the file name. I applied the change along with the new nvd3 js file and that didn't fix the graphs.

Link to comment
Share on other sites

8 hours ago, activa said:

This issue related to Unicode chars in gateway names not related to loading graphs.

this is correct.

14 hours ago, evolvewh said:

Thanks for the file name. I applied the change along with the new nvd3 js file and that didn't fix the graphs.

the graphs loading is another issue . i think the graph loading issue has a relation about the order how has the Ajax request sent, i think blesta should load the js files then load the widget, as the widget is loaded before the js files then the js script is not applied to the widget, unless you re-load the page . this someting that @Paul or @Tyson should test it .

Link to comment
Share on other sites

On 9/9/2017 at 7:11 AM, Blesta Addons said:

the Issue in not related to the nvd3, is a Blesta issue, the Html->_() call the safe() function that is stripe the HTML utf-8 chars instead of the ifSet() function that return the string as is it .

Html::_ is desired because it prevents XSS while Html::ifSet does not. However, nvd3 does not render the HTML-safe characters correctly. If nvd3 could render HTML-encoded characters correctly that would be great. Another solution could be to use HTML::ifSet but strip any quotes out first to avoid the possibility of the name breaking the JSON format and introducing its own JS via XSS.

8 hours ago, Blesta Addons said:

the graphs loading is another issue . i think the graph loading issue has a relation about the order how has the Ajax request sent, i think blesta should load the js files then load the widget, as the widget is loaded before the js files then the js script is not applied to the widget, unless you re-load the page . this someting that @Paul or @Tyson should test it .

The graphs failing to load sometimes is a separate issue. The JS for d3/nvd3 could not be loaded before the widget since they are defined and used from inside the widget. I don't see that as a workable solution in any case because it could end up causing a race condition (e.g. maybe the widget loads before the JS loads anyway) that leads to the same issue, assuming the race condition is the issue in the first place. The JS is already set to load in its required order of (1) d3 (2) nvd3 (3) generate graphs.

Link to comment
Share on other sites

On 11/09/2017 at 7:12 PM, Tyson said:

Html::_ is desired because it prevents XSS while Html::ifSet does not. However, nvd3 does not render the HTML-safe characters correctly. If nvd3 could render HTML-encoded characters correctly that would be great. Another solution could be to use HTML::ifSet but strip any quotes out first to avoid the possibility of the name breaking the JSON format and introducing its own JS via XSS.

we hope a fix soon, doesn't matter how, but it would be good to see Unicode characters correctly in the graphs.

On 11/09/2017 at 7:12 PM, Tyson said:

The graphs failing to load sometimes is a separate issue. The JS for d3/nvd3 could not be loaded before the widget since they are defined and used from inside the widget. I don't see that as a workable solution in any case because it could end up causing a race condition (e.g. maybe the widget loads before the JS loads anyway) that leads to the same issue, assuming the race condition is the issue in the first place. The JS is already set to load in its required order of (1) d3 (2) nvd3 (3) generate graphs.

i have make another look and i see that the ajax request (GET https://xxxxxxx.com/admin/widget/billing_overview/admin_main/ ) are loaded before the  .js files loading .i have tested with a small download debit rate to simulate correctly the loading time .

below the result, the order is how blesta send the call :

GET https://*******.com/administration/widget/billing_overview/admin_main/	200 OK	4,28s
GET https://*******.com/vendors/d3/d3.min.js 					200 OK	84ms
GET https://*******.com/vendors/nvd3/nv.d3.min.js				200 OK	18ms

The above result is showing the graph correctly .

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...