Nik Grey Posted February 16, 2014 Share Posted February 16, 2014 This was resolved, thanks to Brian So, I have the trial of the Vector skin and it's exactly what I am looking for.. the problem is my 'Lettering Tool' is throwing error (toys out of pram). I have resolved to see if I can at least get an idea of what the problem is today so Firebug is loaded and I am away. The usual problem for me = No Text Showing. So, this is telling me lots: TypeError: response is null if(response.success == "1") front.js (line 108) Below is the section of code around line 108 from front.js data+="&word="+word+"&size="+size+"&fontid="+fontid+"&text="+text; $.ajax({ type: "POST", url: "modules/external/lettering/ajax/getprice.php", data : data, dataType: "json", success: function(response){ if(response.success == "1") { $("#price_show").val(response.price_show); $("#width").val(response.width); $("#height").val(size); } .. But I don't know how to read it - where do I go next ? Anyone willing to take up the challenge ? Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 I'm watching the browser traffic as the lettering page make its requests to your site. The web server is responding with proper headers, but there is no actual content in the responses. (Request-Line) POST /modules/external/lettering/ajax/getprice.php HTTP/1.1 (Status-Line) HTTP/1.1 200 OK, Content-Length 20, Content-Type text/html; charset=UTF-8 Twenty bytes is headers and other stuff -- no actual content. (Request-Line) GET /modules/external/lettering/ajax/genimage.php?fontid=11&text=WW91ciBUZXh0IEhlcmU=&size=30&colorid=59&t=1392567347055 HTTP/1.1 Response is same as above. I think we need to look at the /ajax/getprice.php and /ajax/genimage.php files. More shortly. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 This is reminiscent of Smarty catching an error in a template, logging the error in PHP's error log, then delivering a completely empty result back to the browser. So, please check your PHP error logs. If it is a Smarty issue, then the error may also show in CubeCart's admin Error Logs. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 Also, please contact your hosting provider and ask them this specific question: Is my account configured in such a way that 'double-dot' folder traversal is limited in any way? In the file /modules/external/lettering/ajax/config.php, there is this statement: require '../../../../ini.inc.php'; I have read of some hosting providers installing some security add-ons to PHP and/or the server in general which severely limits how many times the double-dot traversal can be used in a series. (I have seen some CubeCart 3 mods use a double-dot sequence that is 12 steps long!) Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 If your hosting provider says that due to security measures, double-dot traversal is limited, make the above statement look like: require_once dirname(dirname(dirname(dirname(__FILE__)))).'ini.inc.php'; Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 16, 2014 Author Share Posted February 16, 2014 Fantastic, on it now Ok, error log (well, first page of it): Today, 17:06 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 16:54 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 16:35 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 16:15 [Exception] /mounted-storage/home134/sub002/sc32225-NWDH/greyprint.co.uk/includes/lib/smarty/sysplugins/smarty_internal_templatebase.php:127 - Unable to load template file 'skins/vector/templates/element.product.php' in 'templates/content.homepage.php' Today, 16:15 [Exception] /mounted-storage/home134/sub002/sc32225-NWDH/greyprint.co.uk/includes/lib/smarty/sysplugins/smarty_internal_templatebase.php:127 - Unable to load template file 'skins/vector/templates/element.product.php' in 'templates/content.homepage.php' Today, 16:12 [Exception] /mounted-storage/home134/sub002/sc32225-NWDH/greyprint.co.uk/includes/lib/smarty/sysplugins/smarty_internal_templatebase.php:127 - Unable to load template file 'skins/vector/templates/element.product.php' in 'templates/content.homepage.php' Today, 16:12 [Exception] /mounted-storage/home134/sub002/sc32225-NWDH/greyprint.co.uk/includes/lib/smarty/sysplugins/smarty_internal_templatebase.php:127 - Unable to load template file 'skins/vector/templates/element.product.php' in 'templates/content.homepage.php' Today, 16:12 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 15:38 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 15:38 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 15:25 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 15:24 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 14:10 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 14:10 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 14:07 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 13:06 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 12:56 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 12:52 [Exception] /mounted-storage/home134/sub002/sc32225-NWDH/greyprint.co.uk/includes/lib/smarty/sysplugins/smarty_internal_templatebase.php:127 - Unable to load template file 'skins/vector/templates/element.product.php' in 'templates/content.homepage.php' Today, 12:52 [Exception] /mounted-storage/home134/sub002/sc32225-NWDH/greyprint.co.uk/includes/lib/smarty/sysplugins/smarty_internal_templatebase.php:127 - Unable to load template file 'skins/vector/templates/element.product.php' in 'templates/content.homepage.php' Today, 12:48 [Exception] /mounted-storage/home134/sub002/sc32225-NWDH/greyprint.co.uk/includes/lib/smarty/sysplugins/smarty_internal_templatebase.php:127 - Unable to load template file 'skins/vector/templates/element.product.php' in 'templates/content.homepage.php' Today, 12:48 [Exception] /mounted-storage/home134/sub002/sc32225-NWDH/greyprint.co.uk/includes/lib/smarty/sysplugins/smarty_internal_templatebase.php:127 - Unable to load template file 'skins/vector/templates/element.product.php' in 'templates/content.homepage.php' Today, 12:48 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 12:46 File: [snippet_dd2c731f9eea487f98f31d299c78e91d.php] Line: [3] " " - Query was empty Today, 12:44 [Exception] /mounted-storage/home134/sub002/sc32225-NWDH/greyprint.co.uk/includes/lib/smarty/sysplugins/smarty_internal_templatebase.php:127 - Unable to load template file 'skins/vector/templates/element.product.php' in 'templates/content.homepage.php' Today, 12:44 [Exception] /mounted-storage/home134/sub002/sc32225-NWDH/ Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 16, 2014 Author Share Posted February 16, 2014 I'm still waiting for a response from the host - they did initially reply asking me to elaborate which I have done. I made the change you suggested above and I don't see the error I was getting before that change so you could be onto something I'm on the edge of my seat waiting for the next move ! Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 Some of these error messages are Smarty related, but not with respect to the Lettering Tool. If you have just downloaded the Vector skin, please look in the Vector skin templates folder and determine if the element.product.php file is present. Smarty is complaining that it can't load that file.Next, we need to find out what the snippet dd2c731f9eea487f98f31d299c78e91d belongs to. You will need to look directly at the database, CubeCart_snippets, find dd2c731f9eea487f98f31d299c78e91d, and reply back with everything there is in that table record. Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 16, 2014 Author Share Posted February 16, 2014 element.product.php is present. The nearest table I can find is Cubecart_code_snippet And if I search for (exact phrase) - selecting all tables for: dd2c731f9eea487f98f31d299c78e91d I get no matches. But if I do the same but search for 'All Words' I get 102 matches in the System_error_log If I look in the Cubecart_code-snippet table we have the Two snippets from you - and the Id's look nothing like we are searching for: Here's a screenshot ! Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 OK, I was mistaken. Look for that file in /includes/extra/. Open it in an editor to view its contents. Looks like the only two snippets were from prior conversations on these forums. Please post what that one snippet's contents is. It appears to be not this one: Nor any other snippet in that conversation. Neither snippet makes a database query. It will be interesting to see what line 3 is. Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 16, 2014 Author Share Posted February 16, 2014 Ah, I thought I was missing something.. ok found it: <?php $query = sprintf("SELECT CI.* , C.hide FROM `%1$sCubeCart_category_index` AS CI, `%1$sCubeCart_category` AS C WHERE CI.cat_id = C.cat_id AND CI.primary = 1 ORDER BY CI.product_id", $GLOBALS['config']->get('config', 'dbprefix')); if (($cat_hide_data = $GLOBALS['db']->query($query)) !== false) { foreach ($cat_hide_data as $data) { if ($data['hide'] == 1 && $data['primary'] == 1) { $p++; $this->_displayRandomProduct($p); } } } ?> Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 I wonder what database record this snippet this belongs to? When in phpMyAdmin, the 'php_code' is represented as a "BLOB". You still should be able to view it. Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 16, 2014 Author Share Posted February 16, 2014 The BLOB, or the only ref I can see to a BLOB is: [bLOB - 453B] which can be seen on the screenshot above. I'm a bit lost at the moment, this is the first time I have heard of a BLOB ! Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 You should be able to have phpMyAdmin show you the full contents on any field. Have phpMyAdmin show you the full contents of that column. The question is, relative to line 3 above,: $cat_hide_data = $GLOBALS['db']->query($query) Why is there an error being reported for an empty resultset? So what if it's empty! Anyway, this snippet is telling CubeCart to make another attempt if the current attempt at getting a Random Product found a product whose main category is hidden. If you are running CC528, I think that got fixed anyway. Disable that snippet and see what happens. Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 16, 2014 Author Share Posted February 16, 2014 What must be the contents of this snippet is appearing at the top in a green box (in php myadmin) - I thought this would be the same as the code you gave me for this snippet but it is not. I did disable this snippet but no change - I'm just getting a 'Broken Image' image. Here's the code which appears in php myadmin (I hope this is what you need): <?php $lettering_tool_branch = array('url' => $GLOBALS['storeURL']."/index.php?_a=letter", 'name' => "DIY Vinyl Lettering Tool"); $GLOBALS['smarty']->assign('BRANCH', $lettering_tool_branch); $navigation_tree .= $GLOBALS['smarty']->fetch('templates/element.navigation_tree.php'); $navigation_tree_array = explode("<li>", $navigation_tree); foreach($navigation_tree_array as $navigation_tree_key => $navigation_tree_val) { if (strpos($navigation_tree_val, 'title="Lettering"') !== false) unset($navigation_tree_array[$navigation_tree_key]); } $navigation_tree = implode("<li>",$navigation_tree_array); //$navigation_tree = preg_replace('#<li>.*title="Lettering".*</li>#sU','',$navigation_tree); $GLOBALS['smarty']->assign('NAVIGATION_TREE', $navigation_tree); ?> - <?php $query = sprintf("SELECT CI.* , C.hide FROM `%1$sCubeCart_category_index` AS CI, `%1$sCubeCart_category` AS C WHERE CI.cat_id = C.cat_id AND CI.primary = 1 ORDER BY CI.product_id", $GLOBALS['config']->get('config', 'dbprefix')); if (($cat_hide_data = $GLOBALS['db']->query($query)) !== false) { foreach ($cat_hide_data as $data) { if ($data['hide'] == 1 && $data['primary'] == 1) { $p++; $this->_displayRandomProduct($p); } } } ?> ] Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 That's one of them. Show me the next. The "Broken Image" image still needs resolving. I'm afraid we got sidetracked into solving these error messages. You say you have made the edit to config.php? Honestly, if that statement didn't work without error, other things might go wrong. Ok, I found something... I wish for you to remind me what exact version of CubeCart you are using at greyprint.co.uk? Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 And is this still true for your hosted site: PHP Version 5.4.42 - Ioncube v4.2.2 Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 16, 2014 Author Share Posted February 16, 2014 I changed the lettering/ajax/config.php back to how it was originally (require '../../../../ini.inc.php';) and that original error is back in Firebug. Cubecart version 5.2.8 PHP and Ioncube as you state above still. Here's the code from the other snippet: <?php $query = sprintf("SELECT CI.* , C.hide FROM `%1$sCubeCart_category_index` AS CI, `%1$sCubeCart_category` AS C WHERE CI.cat_id = C.cat_id AND CI.primary = 1 ORDER BY CI.product_id", $GLOBALS['config']->get('config', 'dbprefix')); if (($cat_hide_data = $GLOBALS['db']->query($query)) !== false) { foreach ($cat_hide_data as $data) { if ($data['hide'] == 1 && $data['primary'] == 1) { $p++; $this->_displayRandomProduct($p); } } } ?> - <?php $lettering_tool_branch = array('url' => $GLOBALS['storeURL']."/index.php?_a=letter", 'name' => "DIY Vinyl Lettering Tool"); $GLOBALS['smarty']->assign('BRANCH', $lettering_tool_branch); $navigation_tree .= $GLOBALS['smarty']->fetch('templates/element.navigation_tree.php'); $navigation_tree_array = explode("<li>", $navigation_tree); foreach($navigation_tree_array as $navigation_tree_key => $navigation_tree_val) { if (strpos($navigation_tree_val, 'title="Lettering"') !== false) unset($navigation_tree_array[$navigation_tree_key]); } $navigation_tree = implode("<li>",$navigation_tree_array); //$navigation_tree = preg_replace('#<li>.*title="Lettering".*</li>#sU','',$navigation_tree); $GLOBALS['smarty']->assign('NAVIGATION_TREE', $navigation_tree); ?>] This is all from Greyprint (the test Store is on an older version of CC as I cant test this skin on that as I have been unable to get them to extend my license to that domain so cant test there). Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 So this is the snippet that is throwing the error. As I said earlier, there is no reason for the logging of an empty resultset for a query. Also, as I said, disable this snippet. "I changed the lettering/ajax/config.php back to how it was originally (require '../../../../ini.inc.php';) and that original error is back in Firebug." Uh oh! Make the edit again and I will see if the headers are any different. Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 16, 2014 Author Share Posted February 16, 2014 I did disable that snippet when you told me to. I have changed the ajax/config.php back to your version. and now I still see that error grrrr.. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2014 Share Posted February 16, 2014 I just now tried, looked at the headers, and no difference. More shortly. Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 17, 2014 Author Share Posted February 17, 2014 I just had another reply from my host about the 'Double Dot' question - I don't think they know the answer I will see what I can find out. It's 'Servage' by the way. Someone else replied to my hosting question: Yes,the folder with double-dot will work on your account.There is no restrictions for such folder contents. Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 17, 2014 Author Share Posted February 17, 2014 Brian, yesterday you said you had seen 'something else' ! Looking forward to hearing what that was. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 17, 2014 Share Posted February 17, 2014 By, "I found something," this is what looked interesting... Your most recent efforts are trying to get your Lettering Tool to work on CC528 and/or the Vector skin -- as opposed to working(?) on CC525 and/or a CubeCart stock skin. I believe we have removed - temporarily - the Vector skin as I see the POST/GET requests being made, but nothing coming back from CubeCart. What is supposed to be coming back from /ajax/getprice.php and /ajax/genimage.php is a json_encoded array or an image. Between CC525 and CC528, CubeCart reconfigured it's Controller sequence. Instead of /index.php determining what encoded file to use, that job is now handled by /controllers/controller.master.inc.php. After the appropriate encoded file is run, script execution resumes with /controllers/controller.index.inc.php. controller.index.inc.php is the script file /ajax/config.php wants to pass execution to. Here's the thing that caught my notice: what if the difference in CubeCart's Controller sequence is the problem? Looking at this more in depth, I've determined that this difference cannot be the cause of the problem. Why? Because the ajax request is being sent directly to the Tool's /ajax/ files, not to CubeCart's /index.php start file. Quote Link to comment Share on other sites More sharing options...
Nik Grey Posted February 17, 2014 Author Share Posted February 17, 2014 The Lettering Tool does work with 5.2.8 and all of the stock skins, it's just not working with vector Yes, I am trying to get this to work with vector - thats the problem ! It has to be something this skin is doing differently to the stock skins Quote Link to comment Share on other sites More sharing options...
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.