Yesterday I stumbled upon an minor issue with the TinyMCE-filter for Videofilter. I had previously installed the module on a site, and by request by the client removed the fields for width, height and alignment from the mce-popup since the client didn't want the editors to possibly break the layout by inserting weird values. I removed the fields with a simple hook_form_alter() since I felt that just hiding them with css felt a bit... lame.
The problem with my approach was that since I removed the fields rather than just hiding them and leaving them empty caused the js-validation of the fields to break, resulting in a broken filter tag which doesn't work:
[video:http://www.youtube.com/watch?v=aMUEB_D_dgE&feature=g-vrec&context=G2c3e817RVAAAAAAAAAA width:undefined height:undefined align:undefined]
I've created a simple patch that checks if the fields are present at all, and if so, checks if they're not empty, before proceeding to printing out the variables. I'm not sure how common this problem really is, but I thought I'd document it if someone else bumps into the same issue. One thought would be to make these fields' (width, height, alignment, autoplay) visibility configurable in case admins want to hide them from overcreative editors or such.
| Comment | File | Size | Author |
|---|---|---|---|
| video_filter_tinymce.patch | 1.96 KB | epavletic |
Comments
Comment #1
blackdog commentedFixed in 6.x and 7.x. Thanks!