Closed (fixed)
Project:
Wysiwyg Fields
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2012 at 11:54 UTC
Updated:
9 Feb 2012 at 11:50 UTC
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..
<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>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
Comment #1
decipheredHi 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.
Comment #2
decipheredForgot to mark this as fixed.
Comment #3
tormu commentedGreat, 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.
Comment #4
decipheredThat'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.
Comment #5.0
(not verified) commentedphp code highlighting