sheadawson / silverstripe-shortcodable

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views.
MIT License
48 stars 36 forks source link

remove BOM from shortcode param #5

Closed wernerkrauss closed 10 years ago

wernerkrauss commented 10 years ago

somehow the javascript interprets the current cursor position as BOM, which you cannot see or hear but it confuses php, e.g. placing the cursor on a param name the returned form has a empty field. Debugging this drove me partially crazy but with help in IRC i got it managed. Thanks @Zauberfish for giving the right hints.

A probably nicer solution would be to strip the BOM out in javascript before sending to the controller...

sheadawson commented 10 years ago

Thanks! Yeah I remember getting stumped on this issues when developing the module, was very frustrating. So thanks for persevering and submitting this fix!

wernerkrauss commented 10 years ago

it was indeed very frustrating and a showstopper for using it and giving it to customers. A former filled-in field becomes empty by accidence... :( Glad i found a solution for this.

And thank you a lot for merging so fast!

wernerkrauss commented 10 years ago

wtf-php-debug BTW: See the BOM in action.... The key of "Text" field wasn't Text but TeBOMxt. I really doubted my debugging skills when i saw that