Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When creating a new page via the add content popup, any title i use has all the spaces replaces with a plus.
Is this normal behaviour?
Comment | File | Size | Author |
---|---|---|---|
#7 | outline_designer-title-encoding-issue-2005658.patch | 1.93 KB | datvance |
Comments
Comment #1
chriz001 CreditAttribution: chriz001 commentedfix title typo
Comment #2
btopro CreditAttribution: btopro commentedhmm... never seen that before; browser details please
Comment #3
chriz001 CreditAttribution: chriz001 commentedOops, sorry i forgot to respond to this.
Chrome Version 27.0.1453.110
Comment #4
Brian MacKinney CreditAttribution: Brian MacKinney commentedCan confirm this bug in Chrome and Firefox, when creating new nodes or when updating node titles.
Comment #5
btopro CreditAttribution: btopro commentedis this still in the latest dev?
Regardless I'm going to wait as datvance seemed to suggest in the Reordering thread that this will have an additional patch to resolve coming shortly.
Comment #6
Brian MacKinney CreditAttribution: Brian MacKinney commentedYes, in the latest Dev. Ditto on hope that datvance can find patch here.
Comment #7
datvance CreditAttribution: datvance commentedOk, here's a little patch, but I would test it thoroughly. It looks simple, but there are a lot of moving parts and the underlying issues are actually pretty complex. I'm not sure if this fixes everything going on, I still occasionally see odd stuff with html entities in the titles, but I think that has to do with #4 below.
1. Apache and mod_rewrite encode urls slightly differently, which causes problems with special characters, which is why OD does that weird @2@6@ stuff.
see http://stackoverflow.com/questions/459667/how-to-encode-special-characte...
Ideally, I think Drupal should use the "B" or NE" flag in it's .htaccess. See http://httpd.apache.org/docs/current/rewrite/flags.html
If you're not on Apache, then I don't know how the rewriting/encoding works and I got nothing.
2. Firefox and Chrome seem to encode spaces differently (%20 vs +). I didn't even mess with other browsers.
3. PHP, js/jQuery, and Drupal are all doing some encoding/decoding of their own which you have to take into account.
4. The "reload_table" trigger resubmits the form, which seems to cause some problems in some instances especially on Chrome (e.g. refreshing the page submits again?). It was hard to track down, but again, not sure why it needs to do this.
5. This could all mostly be avoided if Outline Designer didn't submit it's ajax data in the URL. I'm not sure why it's doing that instead of just sending it in the POST, but it would make it a lot simpler. I prototyped that out and it seemed to work well, but it requires a fairly major structural change in OD.
Anyway, all that said, this patch is working for me in production with no complaints from users, but I don't have a lot of confidence in it as a permanent fix for everyone.
Comment #8
btopro CreditAttribution: btopro commentedThank you for tracking this down as well as explaining why my code probably looks really stupid in this area ;)
As per #4 have had issues tracking that down as well, I know not issuing it was causing issues in some browsers.
#5 This is a case of technical debt that's found its way along from Drupal 5 and then the Drupal 6 rewrite of the module helped clean up the ajax (imagine it even worse ;)). I'd gladly accept code restructuring to accomplish this as it's definitely needed and would resolve all issues associated with encoding.
I'd rather it be done the right way then accept this patch at this time. Applying it I didn't experience any issues but I've also not experienced this myself previously.
Comment #9
katyrose CreditAttribution: katyrose commentedIs a more permanent fix for this bug going to be deployed any time soon?
Comment #10
btopro CreditAttribution: btopro commentedI'll commit it if others confirm that this patch fixed the issue for them. We've never witnessed it and we use this on hundreds of sites. Patch is very simple / sane looking, I'm just looking for people who have this issue who then use the patch and it corrects the issue for them to confirm this aside from the original patch poster.
Comment #11
btopro CreditAttribution: btopro commentedComment #12
btopro CreditAttribution: btopro commentedtested on simplytest me. this appears to be a partial fix. When you get into funky character land outline designer seems to get annoyed at updating things. The patch is a temporary fix, a real solution would be POSTing JSON messages and then decoding on the other side; which still could have some issues in the presentation layer but is less likely.
This allows for saving those items more accurately but the & character gets HTML encoded when the AJAX message is sent back, causing it to be listed as the full & item, which still causes issues on transmission. I do think this would clear up a few issues if others would confirm that this is working for them before pushing out this change.
Comment #14
btopro CreditAttribution: btopro commentedFixed in testing, different then patch but similar and also resolves issue with Renaming of items with spaces / funky characters
Comment #15
katyrose CreditAttribution: katyrose commentedGreat! Update is working well for me. No more annoying characters. Thanks!