We're using Visual Select File on a site, but hitting problems with it when used for webform settings fields, specifically the "Confirmation message" field found at /node/<nid>/webform/configure
The VSF icon is shown correctly in the ckEditor toolbar, however clicking on it yields the following JS error:
Uncaught TypeError: Object #
has no method 'openModal'
The problem appears to be that visual_select_file.js is NOT loaded on that page. This seems to be down to the logic in
visual_select_file_pre_render_wysiwyg_element(). Action is only taken here if
$element['#entity_type'] is set, which it isn't for the confirmation field on the webform settings.
Any advice welcome.
Comments
Comment #1
rudiedirkx commentedEeeeeh. yeah I only had Fields in mind, not other wysiwyg loads... I don't know how to fix and I'm not working with VSF at this time, so I'm not fixing it any time soon. Maybe alter the element registry and add a pre_render for all wysiwyg fields and then load VSF even without entity context.
If you do fix it, patch it, I'll commit it. I suppose a Field isn't strictly necessary to load VSF (just has less context then), so shouldn't be too hard..? Famous last words.
Comment #2
rudiedirkx commentedAny work here? Would still be a cool addition. I'm working on VSF again, so I'll look into it some time soon.
Comment #3
rudiedirkx commentedComment #4
leewillis77 commentedHi,
Sorry for the delay replying. I wasn't part of the project team on this site build, so I had to check with a few people. It appears that we worked around this issue - it wasn't enough of a deal-breaker for us to spend significant time on I'm afraid.
I think it would be nice to have, but not urgent for us (Feel free to deprioritise / close if you'd like).
Comment #5
rudiedirkx commentedVSF now (dev, 1.7 soon) works on every WYSIWYG field that has the right metadata. There are 2 ways to define that metadata:
More info in the api.php.
VSF on
fileelement is much trickier, because VSF uses Filefield Sources for its submission logic. Patches very welcome.