Generating lots of redirects fails with collisions.

Created on 1 December 2011, over 12 years ago
Updated 2 May 2024, about 2 months ago

When I attempt to use devel generate to create 30000+ redirects, it fails with an integrity constraint violation. This is just because the names of the paths are not unique enough.

I fixed this in _redirect_generate_url() by appending a string created by uniqid() to the end of:

$url[] = devel_generate_word(mt_rand(6 / $i, 8)) . uniqid();

This makes the URLs a little less pretty, but at least I can generate more than 2000 at a time (or however long it takes before colliding with another redirect).

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΏπŸ‡¦South Africa Mark Theunissen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024