Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Lose Formatting When Updating Product Description


ariels

Recommended Posts

Hi there,

When I go to update a product, even if I just change the title, the description loses all HTML formatting. Not only that, when I fix it, and then hit update, it doesn't take the HTML formatting I edited.

 

Does anyone have any suggestions?

 

I successfully installed the TinyMCE-wyswyg HTML editor to see if that could help, but it didn't change the fact that it wouldn't update.

 

I also re-uploaded the product image successfully prior to hitting "update".

 

Any suggestions would be helpful as I now cannot edit any product pages.

Link to comment
Share on other sites

If it simply alters the HTML tags I'd say you might have done this.

 

If it strips them out completely I wouldn't know where to begin.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

The only PHP function I can think of that would do that is strip_tags

 

As far as I know that function probably shoulddn't be in the admin code anywhere as HTML tags are sometimes required in the admin.

 

You should search the admin code for instances of that function.

 

If it is there it's probably:

 


  •  
  • 1. A mistake.
  • 2. A file accidentally uploaded into the admin side from the catalog side.
  • 3. A security measure applied to the admin code that shouldn't have been.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

The only PHP function I can think of that would do that is strip_tags

 

As far as I know that function probably shoulddn't be in the admin code anywhere as HTML tags are sometimes required in the admin.

 

You should search the admin code for instances of that function.

 

If it is there it's probably:

 


  •  
  • 1. A mistake.
  • 2. A file accidentally uploaded into the admin side from the catalog side.
  • 3. A security measure applied to the admin code that shouldn't have been.

 

I can't believe it, but I actually fixed this with this tip. There was code on admin/database.php that I commented out and all was well. Adding it here (with comments) in case anyone has this same issue. For me it was line 135-142

 

// Strip HTML and PHP tags from string

// if (!$skip_stripping) $string = strip_tags($string);

 

// if (function_exists('mysql_real_escape_string')) {

// return mysql_real_escape_string($string, $$link);

// } elseif (function_exists('mysql_escape_string')) {

// return mysql_escape_string($string);

// }

Link to comment
Share on other sites

That is because you uploaded the includes/functions/database.php from the catalog side into the admin side. Replace that with the correct file and the problem should disappear.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...