Blesta Addons Posted June 13, 2017 Report Posted June 13, 2017 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" . Quote
Paul Posted June 13, 2017 Report Posted June 13, 2017 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/ Quote
Blesta Addons Posted June 13, 2017 Author Report Posted June 13, 2017 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']);?>", Michael and activa 2 Quote
activa Posted September 3, 2017 Report Posted September 3, 2017 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 !!!!! Quote
Blesta Addons Posted September 9, 2017 Author Report Posted September 9, 2017 Another Self::+1 for my patch Quote
evolvewh Posted September 9, 2017 Report Posted September 9, 2017 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? Quote
evolvewh Posted September 9, 2017 Report Posted September 9, 2017 This seems to be working better so far: https://github.com/novus/nvd3/releases/tag/v1.8.6 Quote
Blesta Addons Posted September 9, 2017 Author Report Posted September 9, 2017 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 ? Quote
evolvewh Posted September 10, 2017 Report Posted September 10, 2017 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. Quote
activa Posted September 11, 2017 Report Posted September 11, 2017 This issue related to Unicode chars in gateway names not related to loading graphs. Quote
Blesta Addons Posted September 11, 2017 Author Report Posted September 11, 2017 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 . Quote
evolvewh Posted September 11, 2017 Report Posted September 11, 2017 Got it. I misunderstood that part of it. Quote
Tyson Posted September 11, 2017 Report Posted September 11, 2017 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. Michael 1 Quote
Blesta Addons Posted September 19, 2017 Author Report Posted September 19, 2017 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 . Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.