shopmaker Posted September 12, 2018 Share Posted September 12, 2018 Cubecart v 6.2.2 Browser Chrome Windows 10 Hi. I'm new to Cubecart and have set up a new store over the last two weeks which is now live. I've pretty much got all of it going to my liking. I've installed the Kurouto skin and noted that a few options stopped working, such as "hide document title". This is not a big issue and I can live with it, but the following problem is bugging me. When I first installed I tried the currency update option it worked fine and it fetched the rates no problem. Now I try it and all I get is a blank screen and the following error in the system error log: [Exception] /home/tvcommco/public_html/store/admin_xxxxxx/sources/settings.currency.inc.php:37 - String could not be parsed as XML If anyone could point me to a solution I'd be very grateful. My store address is https:www.welovefabric.co.uk/store Thank you. Link to comment Share on other sites More sharing options...
keat Posted September 12, 2018 Share Posted September 12, 2018 I've never used or even seen that feature, so I went looking. The same thing happens to me. Try this. Edit admin.xxx/sources/settings.currency.inc.php around line 27, you should find the current address for fetching the currency rate. www.ecb.europa.eu', '/stats/eurofxref/eurofxref-daily.xml Change this to: https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml Seems to work for me. Link to comment Share on other sites More sharing options...
havenswift-hosting Posted September 12, 2018 Share Posted September 12, 2018 This has already been reported and fixed for release in the next version https://github.com/cubecart/v6/issues/2165 Link to comment Share on other sites More sharing options...
shopmaker Posted September 12, 2018 Author Share Posted September 12, 2018 Ok, thank you. Works perfectly! Link to comment Share on other sites More sharing options...
shopmaker Posted September 12, 2018 Author Share Posted September 12, 2018 Correction: I no longer get the error message or a blank screen, but the column indicating the last updated date is stuck on the last time it worked, which was August 30th (it's now September 12th). The rates don't seem to have changed, either. Is this the correct XML file? Link to comment Share on other sites More sharing options...
bsmither Posted September 12, 2018 Share Posted September 12, 2018 Please view the Github solution (https://github.com/cubecart/v6/issues/2165) and make your edits accordingly. If the date does not update, and you do not get a banner announcing the success or failure of the update, then we can look elsewhere. Link to comment Share on other sites More sharing options...
keat Posted September 12, 2018 Share Posted September 12, 2018 I wasn't aware of the issue being previously reported, however, after making the change I suggested earlier, it worked for me and showed an update time of yesterday @ 00:00. So I just I ran it again this evening and now get an update time of today @ 00:00, and I'm almost certain the Dollar rate has updated. As a matter of interest, did you change yours to https ? https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml Link to comment Share on other sites More sharing options...
bsmither Posted September 12, 2018 Share Posted September 12, 2018 Just FYI: The Request class strips off anything before, and also, colon-slash-slash. I fear your edit may not have given you the solution you were looking for. Link to comment Share on other sites More sharing options...
shopmaker Posted September 12, 2018 Author Share Posted September 12, 2018 Ok thanks everyone, changing all the links to https was the answer. In the original post it wasn't made clear that there was more than one link to change. Thanks all for your help. Link to comment Share on other sites More sharing options...
KirkM Posted September 13, 2018 Share Posted September 13, 2018 11 hours ago, bsmither said: Please view the Github solution (https://github.com/cubecart/v6/issues/2165) and make your edits accordingly. Did this and still won't work for me. Running CC 6.1.13 and PHP 7.2.9. Anywhere else to make modifications besides the two places mentioned in this resolution? Link to comment Share on other sites More sharing options...
bsmither Posted September 13, 2018 Share Posted September 13, 2018 At what point did it not work? Did you get the banner that said the currency rate update succeeded or failed? Link to comment Share on other sites More sharing options...
shopmaker Posted September 13, 2018 Author Share Posted September 13, 2018 So just to clarify, in the following instructions the "http://" is changed to "https://" in two places, which made it work for me. Initially I'd changed the "http://" only line 27 and got a banner saying that it had failed to update, but it's working fine now after changing both. From the post here:https://github.com/cubecart/v6/issues/2165 /begin/ So, in settings.currency.inc.php, find: if (($request = new Request('www.ecb.europa.eu', '/stats/eurofxref/eurofxref-daily.xml')) !== false) { $request->setMethod('get'); $rates_xml = $request->send(); Change to: if (($request = new Request('www.ecb.europa.eu', '/stats/eurofxref/eurofxref-daily.xml')) !== false) { $request->setMethod('get'); $request->setSSL(); $rates_xml = $request->send(); A few lines later, find: $rates_xml = file_get_contents('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); Change to: $rates_xml = file_get_contents('https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); /end/ Link to comment Share on other sites More sharing options...
KirkM Posted September 13, 2018 Share Posted September 13, 2018 11 hours ago, bsmither said: At what point did it not work? Did you get the banner that said the currency rate update succeeded or failed? Still just the blank page. 10 hours ago, shopmaker said: So just to clarify, in the following instructions the "http://" is changed to "https://" in two places, which made it work for me. Initially I'd changed the "http://" only line 27 and got a banner saying that it had failed to update, but it's working fine now after changing both. From the post here:https://github.com/cubecart/v6/issues/2165 /begin/ So, in settings.currency.inc.php, find: if (($request = new Request('www.ecb.europa.eu', '/stats/eurofxref/eurofxref-daily.xml')) !== false) { $request->setMethod('get'); $rates_xml = $request->send(); Change to: if (($request = new Request('www.ecb.europa.eu', '/stats/eurofxref/eurofxref-daily.xml')) !== false) { $request->setMethod('get'); $request->setSSL(); $rates_xml = $request->send(); A few lines later, find: $rates_xml = file_get_contents('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); Change to: $rates_xml = file_get_contents('https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); /end/ Where is the second https you mention? There are only 2 actions listed here, one is to change the http to https and the other to add the $request->setSSL(); line. I don't see a second change from http to https in these two steps. Link to comment Share on other sites More sharing options...
keat Posted September 13, 2018 Share Posted September 13, 2018 Around line 27 if (($request = new Request('www.ecb.europa.eu', '/stats/eurofxref/eurofxref-daily.xml')) !== false) { $request->setMethod('get'); $rates_xml = $request->send(); Change to: if (($request = new Request('https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml')) !== false) { $request->setMethod('get'); $request->setSSL(); $rates_xml = $request->send(); A few lines later, find: $rates_xml = file_get_contents('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); Change to: $rates_xml = file_get_contents('https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); I never added the line: $request->setSSL(); and it still seems to work. Link to comment Share on other sites More sharing options...
KirkM Posted September 13, 2018 Share Posted September 13, 2018 8 minutes ago, keat said: I never added the line: $request->setSSL(); and it still seems to work. Just a blank page either way with me. Might have to wait for the next version with all the fixes and upgrade my client's store to that and see if it fixes it. Link to comment Share on other sites More sharing options...
bsmither Posted September 13, 2018 Share Posted September 13, 2018 Assuming there is nothing actually wrong with the URL used to contact the bank, please create the error log. Report back whatever entries get logged for today's experiments. Link to comment Share on other sites More sharing options...
KirkM Posted September 13, 2018 Share Posted September 13, 2018 Yes, there is a log generated and there are lots of warnings. error_log.txt Link to comment Share on other sites More sharing options...
bsmither Posted September 14, 2018 Share Posted September 14, 2018 This one may or may not be causing problems: open_basedir restriction in effect. File(/opt/plesk/php/7.2/share/pear/smarty_internal_data.class.php) is not within the allowed path(s): (/var/www/vhosts/anabolnaturals.com/:/tmp/) The autoloader is including /opt/plesk/php/7.2/share/pear/ as a valid directory to look in. Someone will be along shortly to discuss the relevance of this situation. Here is the problem as posted in the Github. The edits there fixes this issue: Entity: line 6: parser error : Opening and ending tag mismatch: hr line 5 and body </body> in /var/www/vhosts/anabolnaturals.com/httpdocs ^ in /var/www/vhosts/anabolnaturals.com/httpdocs Entity: line 7: parser error : Opening and ending tag mismatch: body line 3 and ht </html> in /var/www/vhosts/anabolnaturals.com/httpdocs ^ in /var/www/vhosts/anabolnaturals.com/httpdocs Entity: line 8: parser error : Premature end of data in tag html line 1 The expected response from the bank does not have <hr>, <body>, or <html> tags in it. However, an error document that says, "Please request our secure web page" does. Therefore, some edits that have been made might not have been done correctly. Restore the file to its original, just to make sure you are at the baseline, then apply the edits exactly as you see them at the conclusion of the Github issue thread. However, the error_log entries are all Warnings. Meaning, none of these issues should be causing CubeCart (or PHP) to crash. Unless, we have found a "non-crash dead-end". Meaning, PHP thinks there isn't any more processing to do, but there was no output to send back to the browser either. To answer that, we would need to learn what the Response Code for the Currency Update page request was: 200 OK, or 500 Server Error. Link to comment Share on other sites More sharing options...
KirkM Posted September 14, 2018 Share Posted September 14, 2018 No edits have been made to this file, but I went back and replaced it from the original CC download and added the edits. Same issue. Chrome developer tools network info shows 200 OK. Putting the xml link directly in the url window returns valid xml. CC is just hanging on something somewhere in this script's process. Link to comment Share on other sites More sharing options...
bsmither Posted September 14, 2018 Share Posted September 14, 2018 Any additional entries in the error_log? Also, view in admin, Error Log, System Error Log tab. Link to comment Share on other sites More sharing options...
KirkM Posted September 14, 2018 Share Posted September 14, 2018 Oh man, I am an idiot. I just realized I was updating everything in the admin/sources directory locally with my web editor and then uploading with it. I completely forgot about that very strange feature of CC to copy and rename the admin folder on the server with a random _xxxxx to obscure the login page from bots. I do see the purpose, but it is kind of an oddity that I have never seen before and still can't get used to it in my workflow. I need to remember to push the modified admin folder back to my local site files after upgrades (or at least rename it the same) so it syncs with the right folder. I fixed THAT one and it is now working. Thanks for your time on this. Sorry it was a wild goose chase. Link to comment Share on other sites More sharing options...
keat Posted September 14, 2018 Share Posted September 14, 2018 Been there, done that, and probably will again at some point in the future. Generally, the way I would do this, would be to ftp the file in question to my local pc. Make the edit. Using FTP, rename the original file, something lke ' settings.currency.inc.php.sept18' Then quickly upload the newly modified file. The time between the rename and new upload is minimal. This offers me the protection of being able to roll back quickly, and visibilty of when I last made an edit on that file. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.