Jump to content
Blesta Addons

Graph caption doesn't support unicode letters

Recommended Posts

the graph in the billing at a Galance does show correctly any letter that as accent or any Unicode character . it convert it to a html code accsi . a payment type as "crédit card" will be shown as "Crédit Card" .

 

 

Share this post


Link to post
Share on other sites
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']);?>",

 

Share this post


Link to post
Share on other sites

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 !!!!!

Share this post


Link to post
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?

Share this post


Link to post
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 ?

Share this post


Link to post
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.

Share this post


Link to post
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 .

Share this post


Link to post
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.

Share this post


Link to post
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 .

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×