Installed wysiwyg_fields with custom_formatters, added image field and made it appear in the wysiwyg (TinyMCE).
Then added two custom formatters, "large" for a bigger image and "small" for smaller. Code from the other custom formatter:

return theme('image_style', array(
    'style_name' => 'large',
    'path' => $variables['#items'][0]['uri'],
    'alt' => $variables['#items'][0]['alt'],
    'attributes' => array(
      'title' => $variables['#items'][0]['title']
    ),
  )
);

There are multiple ways to get this acting weird, so here are the ones that I've narrowed down..

  • Added one image with formatter "large" and then one with formatter "small". They both appear as "large", though I select "small" for the other. After this the body field without the editor is <p>[wysiwyg_field wf_field="field_body_images" wf_deltas="0" wf_formatter="custom_formatters_large" contenteditable="false"][wysiwyg_field wf_field="field_body_images" wf_deltas="1" wf_formatter="custom_formatters_large" contenteditable="false"]</p>
    All images after this one are added with the "large" formatter ..which is the default for the select-box
  • When adding first image with formatter "small" it works, but the second is "large" though I'd select "small". All images after the first are with formatter "large"
  • Changing the formatter of the first image after doing either of the steps above (and not saving the node between) works. I can change it from small to large and vice versa. Changing the formatter for all the other images doesn't work.
  • Tried changing the formatter for two different images also by editing the code too (wf_formatter="custom_formatters_large" -> ..._small). This usually deletes the image when enabling the wysiwyg again :D
  • Finally I have a node with two images, both same formatter, and I save the node and then edit it to try changing the formatters that way. Changing the formatter for one image works, no matter which I choose to edit. Changing the other one after that usually never works. In some cases it seems to work if the images are in different formatters (small and big) and then I edit the small first and big then - but not the other way.

Keep up the good work, we're gonna use this in production 6th of February anyway - hope to see some of this weirdness gone by then ;)

Comments

deciphered’s picture

Hi tormu,

I believe all of the issues you listed above are the same issue, which has now been fixed and committed: http://drupalcode.org/project/wysiwyg_fields.git/commitdiff/a519e7fcb969...

Let me know how it goes for you.

Cheers,
Deciphered.

deciphered’s picture

Status: Active » Fixed

Forgot to mark this as fixed.

tormu’s picture

Great, all of the problems above solved - except the one that if I edit the formatter manually from the code (wf_formatter="custom_formatters_large" -> ..._small) and then enable the wysiwyg again, that image disappears.

Of course this is a bit niche user case, but certainly something that you wouldn't expect to happen.

deciphered’s picture

That's something that is less likely to get fixed as in most cases the system doesn't have the replacement code available. It could possibly be fixed by triggering a Ajax callback on any tokens that replacement code doesn't exist for, but I'll look into that another day.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

php code highlighting