Development

#3575 ([PATCH] sfSimpleCMS js error when showing File or Image browser in tinymce)

You must first sign up to be able to contribute.

Ticket #3575 (new defect)

Opened 7 months ago

Last modified 1 month ago

[PATCH] sfSimpleCMS js error when showing File or Image browser in tinymce

Reported by: guglielmo.celata Assigned to: Kris.Wallsmith
Priority: minor Milestone:
Component: sfSimpleCMSPlugin Version:
Keywords: tinymce, file browsing Cc:
Qualification: Unreviewed

Description

When the sfMediaLibrary is installed and the app.yml configuration has these lines:

  rich_editing:    on
  tinymce_options: file_browser_callback:"sfMediaLibrary.fileBrowserCallBack"

the insertion of an image in a text-area, pops up the image window, containing the file-browser icon near the URL field.

Clicking on that icon, nothing happens and the following js error appears in the console:

tinyMCEPopup.windowOpener.sfMediaLibrary has no properties
 http://ep20/js/tiny_mce/tiny_mce_popup.js
 Line 272

This has been already discussed here.

A possible solution is to patch the sfSimpleCMSSlotRichText.getSlotEditor() method, in sfSimpleCMSPlugin/lib/slotType/sfSimpleCMSSlotRichText.class.php

The patch is attached.

Attachments

sfSimpleCMSSlotRichText.diff (0.9 kB) - added by guglielmo.celata on 05/18/08 14:21:44.
sfSimpleCMSSlotRichText.diff

Change History

05/18/08 14:21:44 changed by guglielmo.celata

  • attachment sfSimpleCMSSlotRichText.diff added.

sfSimpleCMSSlotRichText.diff

05/18/08 14:35:11 changed by guglielmo.celata

A more general patch, including the checking of the file_browser_callback tinymce option in the configuration file would avoid breaking the plugin's behaviour when sfMediaLibrary is not installed.

Maybe a different way to set up for file-browsing in tinymce would be even better. Taking the idea from sfSimpleBlogPlugin:

in app.yml

  use_rich_text:       true
  use_media_library:   true
  tinymce_options:     width:"100%",height:"450px"

Then it could be possible to manipulate the tinymce options, adding the file_browser_callback:"sfMediaLibrary.fileBrowserCallBack" programmatically and appending the options specified in the app.yml (width and height in this example).

Just an idea.

10/31/08 19:37:32 changed by Kris.Wallsmith

  • owner changed from francois to Kris.Wallsmith.