The node title is stored in a url-encoded form in the cookie when the node is saved. It's never un-escaped though, which means that when it's used as the new value for the autocomplete field after a successfull node submission, you get the url-encoded form, which looks strange in the UI and more importantly isn't recognized as the proper node title by Node Reference when the form is submitted. Attached patch fix the problem by decoding the title in the JS behavior and tweaking the module a bit to use setrawcookie and rawurlencode instead of setcookie (which implicitly calls urlencode on the value) to be able to use decodeURIComponent.
Steps to reproduce:
1- Add a node reference field to any content-type, choose an autocomplete widget, pick some referencable content-types
2- Go to the node creation form for this content-type
3- Open the popup via the Add ... link
4- For the node form in the popup, use the title "Test é ø"
5- Submit the form in the popup
Expected result:
Test é ø displayed in the autocomplete field
Actual result:
Test+%C3%A9+%C3%B8 displayed in the autocomplete field
| Comment | File | Size | Author |
|---|---|---|---|
| decode_titles.patch | 1.01 KB | DeFr |
Comments
Comment #1
starbow commentedThanks for the patch. I will give this a test. I completely forgot to test with unicode characters.
Comment #2
starbow commentedChecked into dev. This will be in RC2. Thanks.