Editing in html textarea doesn't save contents when clicking 'Save'

Asked by steveparks

I want to cut and paste some code from spreadshirt to display their products on my site:
1. An iframe on a 'page' node showing a shopfront display
2. Blocks displaying a product from spreadshirt.

But the code I cut and paste, even in HTML view in the editor, doesn't work, then when i go back into the page or the block the textarea is empty.

Is this a filter (I selected full HTML)? or is it something to do with the editor?

How would I fix this please?

Thanks very much for your help.

Also, thanks for such a great drupal distribution. It was so easy to install, and works like a dream. Really well designed and implemented.

cheers
Steve

Question information

Language:
English Edit question
Status:
Solved
For:
ProsePoint Edit question
Assignee:
No assignee Edit question
Solved by:
steveparks
Solved:
Last query:
Last reply:
Revision history for this message
bengtan (bengtan) said :
#1

Hi,

There is an intermittent bug with the visual editor when inserting HTML code. It seems you have to switch back to visual mode before saving your node, otherwise changes are lost. It's a weird one, and we've only recently become aware of it.

So, try that and see how you go.

However, in visual mode, the editor may try to clean up your code for you. Depending on what you're pasting, that might corrupt your code :(

If so, you can try:

Using the HTML popup to insert your code, or disabling javascript to disable the visual editor.

I hope the first suggestion (switching back to visual mode before saving) works, because the other workarounds are embarassing.

Let me know how you go.

Oh, and thanks for using ProsePoint.

Revision history for this message
bengtan (bengtan) said :
#2

Hi,

I've got a fix for you, if you feel comfortable editing a source file.

In the file .../profiles/prosepoint/modules/prosepoint/prosepoint_editor/pp_ed.js, line 73 reads:

Drupal.pp_ed_select = function(elem, select) {
  if (select == 'tinymce') {
    ed = tinyMCE.get(elem.id);
    if (!ed) {
      tinyMCE.execCommand('mceAddControl', true, elem.id);
    }
    else if (ed.isHidden())
      ed.show();
  }
  else if (select == 'code') {
    ed = tinyMCE.get(elem.id);
    if (ed) {
      if (!ed.isHidden())
        ed.hide();
    }
  }
}

Change this to:

Drupal.pp_ed_select = function(elem, select) {
  if (select == 'tinymce') {
    tinyMCE.execCommand('mceAddControl', true, elem.id);
  }
  else if (select == 'code') {
    tinyMCE.execCommand('mceRemoveControl', true, elem.id);
  }
}

In other words, replace the entire function. When you try this, don't try to type it out. Instead, just copy and paste from here.

Also, you may have to refresh your browser (Ctrl-F5) to make sure it fetches the changed file.

After this change, switching the editor between visual and html mode takes a bit longer (about 1 second), but you should be able to edit the contents of the html textarea and then save directly.

If you still have the problem, please let us know. We're very keen in getting this bug fixed.

Thank you.

Revision history for this message
steveparks (steve-parks-redgroup) said :
#3

Thanks for such a speedy response! What great support for an OS project.

I have changed the function you suggest above - and I can confirm it works.

Thanks very much for fixing it.

Steve