#59 fix for orhphan pages

This commit is contained in:
Hamid Reza Mohammadi 2021-01-07 17:29:59 +03:30
parent 28147b1836
commit 8952cbdeea

View File

@ -1103,9 +1103,19 @@ namespace RMuseum.Services.Implementation
}
}
}
else
{
cat = await context.GanjoorCategories.Where(c => c.PoetId == page.PoetId && c.ParentId == null).SingleOrDefaultAsync();
if(cat != null)
{
fullUrl = $"{cat.UrlSlug}/{page.UrlSlug}";
}
}
}
}
if (!string.IsNullOrEmpty(fullUrl) && fullUrl.IndexOf('/') != 0)
fullUrl = $"/{fullUrl}";
page.FullUrl = fullUrl;
page.FullTitle = fullTitle;
@ -1114,7 +1124,7 @@ namespace RMuseum.Services.Implementation
await context.SaveChangesAsync();
await jobProgressServiceEF.UpdateJob(job.Id, 100, "Finised", true);
await jobProgressServiceEF.UpdateJob(job.Id, 100, "Finished", true);
}
catch(Exception jobExp)
{