Redirect URLs not deleted with pages
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
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
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.
Hi Christine,
I have tried to reproduce this with the steps provided by Adam.