Jump to content
Sign in to follow this  
Ady

WYSIWYG 1.7 Problem

Recommended Posts

I have installed the above contrib, and everything appears to work ok...apart from one thing...

 

I can edit the product description no problem, but if i have a / anywhere in the description, next time I go back to the edit page, it ends up with extra /'s in there. And then if i go back out and back in..another // until i end up with 5 or 6 at a time appearing over and over throughout my description. Sometimes its putting " in there aswell where they were never typed, thus throwing out all the editing.

 

Anyone had the same problem but overcome it, or any ideas?

Share this post


Link to post
Share on other sites

Hi osc community,

 

make or edit a existing .htaccess file in your admin-directory and add (or in httpd.conf):

 

php_flag magic_quotes_runtime off

php_flag magic_quotes_gpc off

 

 

it's a php feature and it's a general problem in textareas if you use html like: ="http://gpsmuc.de/images...'>http://gpsmuc.de/images... makes =\"http://gpsmuc.de/images...'>http://gpsmuc.de/images... next time =\\"http://gpsmuc.de/images.. fun for php, bad for osc people who want to add an image in product description or in any wysiwyg HTML editor too.

 

 

If you have access to your php.ini you can switch off magic_quotes there:

 

magic_quotes_runtime = off

magic_quotes_gpc = off

 

hope it's help

 

greetings

Helmuth

Share this post


Link to post
Share on other sites

Yes. and I still can't stop it. It is making me think of giving up and getting another package.

Any workarounds tto this problem?

Getting Desperate!!

 

Dicon

Share this post


Link to post
Share on other sites

Donno if it will help, but what I did (not for the categories/products page) was to actually have some stripslashes($HTTP_POST_VARS['description']) in the edit page too. So that when going back to the edit page the slashes that where added in posting back to the page are removed, so everything is as should be.

Which seems to of worked well for me in my preliminary tests. So, open up cateories.php (or whatever) and find the bits where the variables passed are entered into the text areas and enclose them with stripslashes().

 

Actually I discovered the best solution is to use the osC objectInfo class, basically it strips the slashes for you, and you will also notice that it is used when retrieving data from the database. So my code now looks like this:

  if (tep_not_null($HTTP_POST_VARS)) {
   $eInfo = new objectInfo($HTTP_POST_VARS);
 } else {
     $eID = (int)$HTTP_GET_VARS['eID'];
     $events_query = tep_db_query("select * from " . TABLE_EVENTS . " ev where ev.events_id = '" . $eID . "'");
     $events = tep_db_fetch_array($events_query);
     $eInfo = new objectInfo($events);
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
       $language_id = $languages[$i]['id'];
       $events_language_query = tep_db_query("select * from " . TABLE_EVENTS_DESCRIPTION . " ed where ed.events_id = '" . $eID . "' and ed.language_id = '" . $language_id . "'");
       $events_info = tep_db_fetch_array($events_language_query);
       $events_name_array[$language_id] = $events_info['events_name'];
       $events_description_array[$language_id] = $events_info['events_description'];
     }
     $events_name = array ('events_name' => $events_name_array );
     $events_description = array ('events_description' => $events_description_array );
     $eInfo->objectInfo(array_merge($events_name,$events_description));
 }

Then all that is neccessary to use the data is to use $eInfo->events_id etc and you know that the slashes have been taken care of, the additional bonus of doing this is that you no longer have to worry about whether you are accessing form POST vars or database vars when constructing the form.


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites

Hi,

 

so call your provider, may be the "php_flag magic_quotes_gpc off" is not allowed in a .htaccess file and it must be switched off directly in the httpd.config. If you own a root server no problem otherwise your provider has do do it for you (may be they do it or not)

 

 

greetings

Share this post


Link to post
Share on other sites

Dear Helmuth...

Followed your advice, contacted my provider ( SupaNames and asked for the "Magic_quotes" to be turned off. This evening I got an email saying thay had done so and, as far as I can see with the few hurried test I did THE PROBLEM IS SOLVED.

YAY!!!!

Thanks for the advice. :D .

 

Dicon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×