+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Redirect URLs not deleted with pages

Redirect URLs not deleted with pages

4 posts, 0 answered
  1. Adam
    Adam avatar
    16 posts
    Registered:
    29 Nov 2011
    08 Feb 2012
    Link to this post
    I am using Sitefinity 4.3, and I believe I have uncovered a bug.

    We had copies of our site running on different machines from different databases. Recently, we found we were not able to specify additional urls for pages in only one of the sites. Whenever we tried, we received a javascript popup window containing the message "undefined" when trying to save changes to the page.

    We had deleted many pages from that site instance and rebuilt them, due to a corrupted control that prevented us from loading the pages into the editor. The other sites did not have this problem.

    What I eventually found was that I could add additional URLs for the pages, as long as the urls weren't the ones we had used before. For example, if the old (deleted) page had an additional URL "~/products/15", I could not give any new page that additional url. I would receive the "undefined" message. However, if I assigned a made up number, like "~/products/34134524356", that would allow me to save without issue. Of course, I didn't want it to route to the made up url, I wanted it to use the one from the previous deleted page!

    This got me thinking, and I dug around in the database until I found the sf_url_data table. I searched for all the records with redirect=1, and beginning with "~/products", and found all the old additional url values from the deleted pages. I believe these urls are preventing me from re-adding the routes to the new pages.

    Now, here is where it really gets interesting: I tried to reproduce this bug by creating and deleting a page, but that cleaned the database properly. Then I remembered, as many of the deleted pages were similar, we were using the "duplicate" functionality of sitefinity. Once I tried using duplicate, I was able to reproduce the problem.

    Steps to reproduce:
    Create a page in sitefinity. Assign it an additional url. (in this case, "~/test3/1")
    Run this script against the database:
    SELECT *
      FROM [Sitefinity].[dbo].[sf_url_data]
    where redirect = 1

    See your page's redirect is present. (copy of database row)
    ~/test3/1    1    NULL    2012-02-08 21:35:30.430    0    16642540-F81B-465B-AAC6-38BEAAED0170    0    127    SitefinityTest/    1    811102197    NULL    D6DE5123-0D85-4E87-B928-C25DBE1E189A

    Now, from the "Actions" menu of the page, choose "Duplicate". On the properties page of your new page, enter a different additional url. ("~/test3/2"). Save and return to pages.
    See the following two rows in the database, which were created at exactly the same moment in time:
    ~/test3/1    1    NULL    2012-02-08 21:36:28.903    0    E71699DC-C58C-48A6-A933-72C78ACE5974    0    127    SitefinityTest/    1    811102197    NULL    NULL

    ~/test3/2    1    NULL    2012-02-08 21:36:28.903    0    D4D2CF21-E018-4284-9A29-B93BEE6463E9    0    127    SitefinityTest/    1    811102197    NULL    4F6C3114-DC69-4C09-B3D2-61C1642F0179

    Also notice that the last column is null for the additional "~/test3/1" row. I'm betting this is a key to the page?

    Now, delete the second page.

    See that the "~/test3/2" row was deleted, but this row remains:
    ~/test3/1    1    NULL    2012-02-08 21:36:28.903    0    E71699DC-C58C-48A6-A933-72C78ACE5974    0    127    SitefinityTest/    1    811102197    NULL    NULL

    It appears that duplicate creates a second copy of the original page's redirect url, which does not get deleted with the page. As far as I can tell, the only solution is to remove this row manually.
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    02 Dec 2016
    13 Feb 2012
    Link to this post
    Hi,

    Thank you for sharing this solution with the community, we really appreciate your valuable contribution. We used to have an issue with multiple URLs for a page not being deleted from the url data table in the database in pre-4.4 versions of Sitefinity, which might result eventually in similar behavior. The problem has been fixed for 4.4.

    Regards,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Christine
    Christine avatar
    31 posts
    Registered:
    25 Jan 2008
    20 Aug 2012
    Link to this post
    Hello!  Is this issue fixed if you are running a site that was upgraded to 5.0 from 4.4?  Because I just ran into this issue today.  A page with a redirect URL was deleted, but the redirect URL was still present in the sf_url_data table and could not be reused.  I had to manually delete the entry in the sf_url_data table so that our customer could accomplish what they needed to do.
  4. Pavel Benov
    Pavel Benov avatar
    341 posts
    Registered:
    14 Mar 2016
    23 Aug 2012
    Link to this post
    Hi Christine,

    I have tried to reproduce this with the steps provided by Adam.
    • Creating page with additional url
    • Duplicating the page and adding a different additional url
    • Deleting the duplicate
    • Creating page and adding the additional url as the one from the duplicated page
    I have tested this on Sitefinity versions 4.4, 5.0 and 5.1, but everything looked OK. You can take a look at this video recorded on version 4.4. I have used the exact same steps in each of the mentioned Sitefinity versions. 

    Regards,
    Pavel Benov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered