1

Topic: Empty image tag

After upgrading to the last version of TinyMCE and Imagemanager the images inserted have no src attribute anymore (<img border="0" />). The preview in the 'Insert image' dialog does show the correct image though.

I don't have a clue how to fix this. Is it a configuration option I'm missing?

Here's what's passed to TinyMCE:

{apply_source_formatting: 1,
  button_tile_map: true,
  content_css: "/themes/seven/reset.css,/themes/seven/style.css",
  convert_fonts_to_spans: 1,
  convert_urls: false,
  document_base_url: "/",
  entities: "160,nbsp,173,shy,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm",
  extended_valid_elements: "img[src|alt|title|align...eight|align|name|style]",
  language: "en",
  mode: "none",
  paste_auto_cleanup_on_paste: 0,
  plugins: "advimage,advlink,-imagemanager",
  preformatted: 0,
  remove_linebreaks: 1,
  strict_loading_mode: true,
  theme: "advanced",
  theme_advanced_blockformats: "p,address,pre,h2,h3,h4,h5,h6,div",
  theme_advanced_buttons1: "bold,italic,link,image,imagemanager",
  theme_advanced_buttons2: "",
  theme_advanced_buttons3: "",
  theme_advanced_path_location: "bottom",
  theme_advanced_resize_horizontal: false,
  theme_advanced_resizing: 1,
  theme_advanced_resizing_use_cookie: false,
  theme_advanced_toolbar_align: "left",
  theme_advanced_toolbar_location: "top",
  verify_html: 1,
  width: "100%"}

BTW: I'm working on a Drupal module for McFilemaner: http://drupal.org/project/mcfilemanager

Last edited by Skilip (2011-06-08 09:38:23)

2

Re: Empty image tag

I found the problem. After removing the 'extended_valid_elements' option, the Imagemanager works properly again. Sorry for reporting.

3

Re: Empty image tag

Nice to hear that.

Best regards,
Spocke - Main developer of TinyMCE

4

Re: Empty image tag

I am having this same issue.  After upgrading from an early 3.x version to 3.4.4, my custom file browser does not return the image correctly to the editor.  The insert/edit image dialog looks good: Image is in the preview pane and the url looks good.  But when I click the Insert button all I get is <img border="0" /> in the editor.

However, if I then select that broken image icon and replace the image, it works.  Also everything works fine if I use my custom file browser to set the url of a hyperlink.  Just inserting new images is broken.

I see Skilip's fix, but unfortunately getting rid of the 'extended_valid_elements' setting is not an option for me.

Any help is greatly appreciated!

5

Re: Empty image tag

Update on my issue: Skilip's post led me to mess around with the values in my "extended_valid_elements" property in tinyMCE.init().  I didn't have to remove all of my extended_valid_elements, but some apparently conflicted with the newer version of tinyMCE and caused the problem with inserting images.  I can't say exactly which "extended valid elements" were the culprit, but I just removed all that looked outdated or now supported (like iframe) and now things are working again!

6

Re: Empty image tag

Yes, we fixed a issue in 3.4.5 with extended_valid_elements of TinyMCE. If that issue still occurs file a bug report with your tinymce init and we will take a look at it.

Best regards,
Spocke - Main developer of TinyMCE

7

Re: Empty image tag

I think we found out what this issue is.  The attribute "id" MUST be included in the img attribute list.

Last edited by LocoFluffy (2012-06-26 17:33:06)