I had same problem . when I was importing new products with excel import feature , new products has no slug and was not accessible in main site (had not link to view) until I open each one and save it.
I added this small code to Import manager and problem solved.
in file :
\SourceCode\Libraries\Nop.Services\ExportImport\ImportManager.cs
line : about 981
// available Code
tempProperty = manager.GetProperty("SeName");
if (tempProperty != null)
{
var seName = tempProperty.StringValue;
//search engine name
_urlRecordService.SaveSlug(product, product.ValidateSeName(seName, product.Name, true), 0);
}
// NEW CODE, continue after old one
else // if excel not contains column 'SeName' for products
{
// check if product has slug befor
// I'm not sure about this line
var curretntSlug = _urlRecordService.GetActiveSlug(product.Id, product.Name, 0);
if(string.IsNullOrEmpty(curretntSlug))
{
// Add new slug based on Nop utilities for creating slug and insert it
var SeName = Nop.Services.Seo.SeoExtensions.ValidateSeName(product, "", product.Name, true);
_urlRecordService.SaveSlug(product, SeName, 0);
}
}
I have tested this code one or two times , It may crash , but has no danger