Found by @slybud while working on a customer project. Right now, there's a problem if you follow those steps using the DND CK4 plugin:
- Drag an atom into an RTE, go to the atom properties, untick the "Add a caption" box
- Save the entity
- Go to the edit edit form, right click the atom in the RTE, open the atom properties, tick the "Add a caption" box.
At that point, the expected result is to get the default caption showing up. That's not the case though, instead, a blank caption field gets shown ; it's a bit counter intuitive, and that caption field is really hard to access through CKEditor.
Working on a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2496537-3-can-bring-back-the-legends.patch | 2.86 KB | DeFr |
Comments
Comment #1
DeFr commentedThat seems to work for me as a minimal fix.
That being said, the fact that there's 3 AJAX callbacks that tries to fetch extract some metadata about an atom, and that all of them fills Drupal.dnd.Atoms[sid] with slightly different datas seems both error prone and wastefull. Namely, there's
Comment #3
DeFr commentedRe-roll against latest dev.
Comment #4
nagy.balint commentedThanks for the patch.
However i found one issue on code review:
+ $output = $context ? scald_render($atom, $context, $options) : scald_render($atom, 'title');But then we have
if ($context) {So it seems that even though output will be set to the title render, it will never be returned as the context is still not evaluates to true.
Comment #5
DeFr commentedIt won't be returned, but it's still needed to get correct result from theme('sdl_editor_legend', as mentionned in the code comment above and in scald_dnd_library_add_item.
We probably should add a preprocess function to theme_sdl_editor_legend, that ensures that at least scald_prerender got called before trying to output the legend, but that feels a lot like scope creep that I'd rather avoid, and a source of potential issues in the future (right now theme_sdl_editor_legend in Scald core only relies on properties added in the prerender phase, but up to now we've always tried to give it a fully rendered one).
Comment #6
nagy.balint commentedOkey then, its fine for me.
Comment #7
DeFr commentedPushed as 3a5950e