Jump to content

Vector Issue.


Nik Grey

Recommended Posts

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:

 

 
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 ? :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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/

 

 

Link to comment
Share on other sites

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 !

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 !

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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); }
  }
}
?>
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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); } } } ?> ]
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :(

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.

×
×
  • Create New...