Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fixed my last problem, now have another


jhande

Recommended Posts

This is a vicious cycle to say the least.

 

I searched everywhere (even Google'd) for a fix to my new problem(s) and nothing fixed it.

 

I'm running version MS2.2 060817 with a bunch of upgrades and patches.

I finally fixed my Product Listing problem, I missed one line of code from the RC1 upgrade.html.

 

I have had the contribution - Products Short Description v2.2 (by spooks 15 Feb 2008) installed.

But I had reloaded a backed up database so I lost all the short description info. To be safe I ran the SQL query for the mod.

Now when I try to add the product short descriptions I receive these warning messages after I click the Submit button from the Admin Panel -

 

Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/handesho/public_html/catalog/admin/includes/functions/database.php on line 136

 

Warning: Cannot modify header information - headers already sent by (output started at /home/handesho/public_html/catalog/admin/includes/functions/database.php:136) in /home/handesho/public_html/catalog/admin/includes/functions/general.php on line 22

 

Here is the untouched code from the database.php file -

Line 135:___if (function_exists('mysql_real_escape_string')) {

Line 136:____return mysql_real_escape_string($string, $$link);

Line 137:___} elseif (function_exists('mysql_escape_string')) {

Line 138:_____return mysql_escape_string($string);

Line 139:___}

Line 140:

Line 141:___return addslashes($string);

Line 142:_}

Here is the untouched code from the general.php file -

Line 18:___if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {

Line 19:_____tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

Line 20:___}

Line 21:

Line 22:__header('Location: ' . $url);

Line 23:

Line 24:___if (STORE_PAGE_PARSE_TIME == 'true') {

Line 25:_____if (!is_object($logger)) $logger = new logger;

Line 26:_____$logger->timer_stop();

Line 27:___}

Line 28:

Line 29:___exit;

Line 30:_}

 

The short product info does in fact update even though I receive the messages.

There are no blank spaces at the beginning or end of the files.

I don't know if I really have two problems or just one causing a second warning??

 

Any ideas as to what I should look for and where?

 

:unsure: :( :blink:

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

The only file edit that I "think" might be causing a problem is catalog/admin/categories.php

 

Around Line 300 Find:

$description_query = tep_db_query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");

while ($description = tep_db_fetch_array($description_query)) {

tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "','" . tep_db_input($description['products_url']) . "', '0')");

}

Add After:

$description_query = tep_db_query("select language_id, products_name, products_description, short_desc, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");

while ($description = tep_db_fetch_array($description_query)) {

tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, short_desc, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['short_desc']) . "', '" . tep_db_input($description['products_url']) . "', '0')");

}

 

But I am only guessing as I have no knowledge of this.

 

I really would appreciate some educated guess' from those somewhat in the know.

 

I'm so close to having my shop functioning back to normal again, it sure would be nice to fix this last glitch. :blush:

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Have no idea, but I would be inclined to try replace instead of add after. If you keep a back up of the file, you can't be worse off.

Link to comment
Share on other sites

Have no idea, but I would be inclined to try replace instead of add after. If you keep a back up of the file, you can't be worse off.

 

Thank you Leslie, I will give that a try.

 

It did look a bit strange to me, but what do I know. :huh:

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Thank you Leslie, I will give that a try.

 

It did look a bit strange to me, but what do I know. :huh:

 

Is this on a production server or local server like xaamp?

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

Is this on a production server or local server like xaamp?

 

Production server Mark. :(

 

Thanks Leslie for the pointer.

Although that bit of code by itself wasn't the problem, I went through the rest of the code and sort of cleaned it up.

No more warning messages and so far it looks like I'm back in business.

Keeping my fingers crossed. ;)

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Production server Mark. :(

 

Thanks Leslie for the pointer.

Although that bit of code by itself wasn't the problem, I went through the rest of the code and sort of cleaned it up.

No more warning messages and so far it looks like I'm back in business.

Keeping my fingers crossed. ;)

Fantastic, now backup everything.

Link to comment
Share on other sites

Fantastic, now backup everything.

 

Already did, two copies ;)

 

That was a serious panic attack for awhile LOL. :sweating:

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...