Closed (fixed)
Project:
Shorten URLs
Version:
6.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 Sep 2010 at 18:39 UTC
Updated:
3 Jan 2014 at 02:04 UTC
Jump to comment: Most recent
Comments
Comment #1
icecreamyou commentedThat patch will make it impossible for anonymous users to use the URL shortening form. (No shortened URL will appear for them.)
The real way to fix this (and the real reason this is a problem) is by changing the way the form itself is generated. The way it currently works is a hack: the most recent short URL is stored in a cookie and displayed the next time the form is generated. However there are two problems with this: (1) if the user stops the page from loading after the shortened URL has been generated but before the URL shortening form gets regenerated, then the shortened URL will show up the next time the URL shortening form is rendered, even though there is no indication on the form of what long URL it is related to; and (2) if the user submits two URL shortening forms at the same time (e.g. in different tabs) then the shortened URLs could get switched or one of them could get dropped.
The correct way to solve this problem is to use multi-step form structure, which would store the shortened URL in the form cache in the database. However multi-step forms are kind of a pain in D6 so I've never had the motivation to work on it. I've done multi-step forms before and even written a blog post on them, it's just not a fun process.
This is actually a significant problem in this module that has been around since I first added a UI. I've never bothered to fix it because I think of this module as an API first and foremost.
Comment #2
icecreamyou commentedThis is fixed in the D7 branch... but multi-step forms and AJAX are a lot nicer in D7, and I don't know how difficult it will be to get them to play nicely together in D6.
Comment #3
icecreamyou commentedCommitted fix to D6 (dev). It turns out that the required changes are almost identical to D7.