ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Repeat Entry Title query

January 20, 2012 11:39am

Subscribe [4]
  • #1 / Jan 20, 2012 11:39am

    jcowen

    66 posts

    Not so much as a problem - just a query to check I’m not going to run into one in future.

    We’re setting up an events calendar for a client, and there will be several events happening repeatedly through the year. For various reasons we still want new entries for each event - but it’s likely that the Entry title is going to get reused each time.

    From what I can see the url title automatically adds a number to the title, so doesn’t cause any problems. What I want to check though - is there any sort of limit to this ... ie: if they ended up with 50+ entries with the same Title, does a point come when EE is going to complain?

    Thanks

  • #2 / Jan 20, 2012 12:20pm

    Boyink!

    5011 posts

    There is a limit - offhand I can’t remember what it is. Seems like either 50 or 99…

  • #3 / Jan 20, 2012 12:44pm

    jcowen

    66 posts

    Ahhh - thanks.
    Do you know what happens when that limit is reached?

    If you get an error saying you can’t use that post title, pick another - that’s fine. If it accepts the new entry but then starts giving DB errors - it might be more of an issue.

    Thanks

  • #4 / Jan 20, 2012 1:14pm

    Boyink!

    5011 posts

    Haven’t seen it for sure, but would hope it’s a CP-based error.

  • #5 / Jan 22, 2012 8:16am

    Sean C. Smith

    3818 posts

    Mekonta,

    I haven’t been able to find any documentation on a limit to re-using the same title. Just to be sure I am going to ask one of the devs to check into this and post back here.

    Sean

  • #6 / Jan 23, 2012 9:53am

    Robin Sowell

    13255 posts

    In 1.x, there was indeed a limit- because it basically looped through attempting to find a url that wasn’t a duplicate.  In the current code, the check is more clever and there is not a limit.  The more clever is found in the API library- the _unique_url_title- which basically generates a query like:

    SELECT url_title, MID(url_title, 6) + 1 AS next_suffix FROM (`exp_channel_titles`) WHERE `url_title` REGEXP('chloe[0-9]*$') AND `channel_id` = '2' ORDER BY `next_suffix` DESC LIMIT 1

    Which should produce a next_suffix that is one more than the current highest suffix.  Then we stick that on it- do an extra query just to make sure it’s not a duplicate- and send the new url_title on its merry way.

    So short answer?  In the current code and beyond (2.3.1) you shouldn’t have an issue with duplicate url_title limits.

  • #7 / Jan 23, 2012 9:57am

    Boyink!

    5011 posts

    Cool - thanks Robin!

  • #8 / Jan 27, 2012 8:01pm

    Kevin Smith

    4784 posts

    mekonta, is there anything else we can help answer for you?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases