[DC-623] Impossible to create non-unique slugs Created: 09/Apr/10  Updated: 31/Aug/10

Status: Open
Project: Doctrine 1
Component/s: Sluggable
Affects Version/s: 1.2.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Adwise Internetmarketing Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 2
Labels: None

Attachments: Text File dc-623.patch    


I want to create a non-unique slug of a title field from my table.

But I've found that when I change unique from 'true' to 'false' the slugs were not created or updated

In lib\Doctrine\Template\Listener\Sluggable.php inside preUpdate() function the first if() statement disables the unique (false) option.

Comment by Jacob Mather [ 30/Aug/10 ]

Theoretically this should clear up the issue. Sorry for not having the time for a complete test at the moment,

Comment by webPragmatist [ 30/Aug/10 ]

The patch by Jacob doesn't work. The reason for the unique check is to bypass appending a numeric value to the end of a slug in the even two exist.

It just needs to somehow be directly sent to the urlize function.

Comment by Jacob Mather [ 31/Aug/10 ]

I would just like to post an update after I've been able to test:

The only functionality that i found actually broken was updating a slug with unique set to false.

The reason was the wrapped if.

If you set unique to false, slugs will still fail to update as canUpdate must also be set to true.

The patch, so far as I can determine, does correct the underlying issue if a slug failing to update when unique is false and canUpdate is true.

Generated at Wed Nov 25 19:39:44 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.