Tinymce image insert, works the second time, but not the first

I use CakePHP and a custom file browser with TinyMCE.

Here is my callback:

<script type="text/javascript">

function fileBrowserCallBack(field_name, url, type, win) { 
            browserField = field_name; 
            browserWin = win; 
            window.open('/controller/mupload', 'browserWindow', 'modal,width=600,height=500,scrollbars=yes');
        }


tinyMCE.init({ 
            mode : 'textareas', 
            theme : 'advanced', 
            // theme specific stuff

            file_browser_callback: 'fileBrowserCallBack', 
            width: '620', 
            height: '380', 
            relative_urls : false 
        });
</script> 

My window.openin the callback refers to my loading script, in CakePHP. This image loading and display is excellent. When I select an image, the pathImage URL symbol appears in the TinyMCE field - everything seems to work.

Then I click Insert, and TinyMCE adds this HTML:

<p><img border="0" /></p> - completely ignores the path to the image - even if it is installed.

If I then click "Insert Image" and go to another (or the same), and then select the insert, the image will look perfect, with the correct path, as you would expect.

, , .

- , , , . .

Firebug .

?

TinyMCE:

majorVersion:"3",
minorVersion:"4.2",
releaseDate:"2011-04-07"

.

+3

All Articles