Jump to content

[Resolved]Error substr() expects parameter 3 to be long, string given


Claudia M

Recommended Posts

Hi,

I just happened to check my error log today and had over 1200 errors (stupid me cleared the log).  I enabled debug and I get the following on the product page.

PHP:
[Notice] /home1/willow39/public_html/includes/extra/snippet_104bb9b78ffedd542f9177bff9811498.php:1 - Undefined index: JM468
[Warning] /home1/willow39/public_html/classes/catalogue.class.php:1279 - substr() expects parameter 3 to be long, string given

 

On the category page I get this

PHP:
[Notice] /home1/willow39/public_html/includes/extra/snippet_104bb9b78ffedd542f9177bff9811498.php:1 - Undefined index: JM468
[Notice] /home1/willow39/public_html/classes/seo.class.php:479 - Undefined variable: title

 

I did make major changes to my categories (made some children renamed some) when I upgraded to V6.

 

On the site docs I get this

PHP:
[Notice] /home1/willow39/public_html/includes/extra/snippet_104bb9b78ffedd542f9177bff9811498.php:1 - Undefined index: JM468

Any help is appreciated,

Claudia

Link to comment
Share on other sites

It seems to me that CubeCart's in-house programming style-book allows for the un-quashed "Undefined index" errors. To PHP, it has no deleterious effects.

On the other hand, the "Undefined index" is in a snippet. So, it might be of some small interest to figure out what snippet it is referring to, and determine if quashing the error is in the best interest. You can determine what the snippet belongs to by opening the file in a programmer's text editor.

In catalogue.class.php, line 1279, this statement will use a product's short description as derived from it's full-sized description. Baring an actual syntax error in your file, the PHP function in question is:

substr(strip_tags($product['description']), 0, $GLOBALS['config']->get('config', 'product_precis'))

And specifically, the third argument is:

$GLOBALS['config']->get('config', 'product_precis')

So, in admin, Store Settings, Layout tab, "Length of product precis", make sure there is an integer value entered here.

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