Try our conversational search powered by Generative AI!

Disable product pages are not redirecting to 404.

Vote:
 

Hi,

I am using default routing as CatalogRouteHelper.MapDefaultHierarchialRouter(RouteTable.Routes, false);

Example Product URL is http://pro.development.local/uk/db/books/gaming/game-genre/action/age-of-empires-1/, It works fine

If I set Available=False for this product from Commerce manager, I expect it will redirect to 404 but rather it is redirecting to 

http://pro.development.local/Util/login.aspx?ReturnUrl=%2fuk%2fdb%2fbooks%2fgaming%2fgame-genre%2faction%2fage-of-empires-1%2f

I put a breakpoint in Controller Index method but it doesnot hits that line.

I am wondering is it a bug and where can I take the control for this situation to redirect user to 404.

Regards

Khurram

#89850
Aug 27, 2014 13:16
Vote:
 

Please Note: If I am already logged in as admin then it shows me 404.

#89851
Aug 27, 2014 13:20
Vote:
 

For me it sounds like a bug, as it is not consistent with what we behave with CMS contents.

I filed a bug for that to see if this needs to be changed.

Regards.

/Q

#89948
Aug 29, 2014 4:39
Vote:
 

Hi Quan/

Thanks, Can you please add another test case, i.e. Product availability is true but publishing starting date is in future or expired.

Regards
/K

#89963
Aug 29, 2014 9:13
Vote:
 

Hi Quan,

Can you please tell me bug Id for tracking.

Regards
/K

#90114
Sep 02, 2014 11:49
Vote:
 

Unfortunately our triage team decided to leave the behavior as-is, i.e closed the bug as won't fix. Currently we have work items in higher priority so there'll be no changes for now.

We might revisit later if this bug makes sense for many customers.

Regards.

/Q

#90123
Sep 02, 2014 14:09
Vote:
 

Well its Ok, 
So how can I get the control of a request if it the requested Product is not avaialbale any more? Will you recommend me to do custom routing?

Regards
/K

#90126
Sep 02, 2014 15:01
Vote:
 

Sorry for the late reply - was quite busy this time. I see no easy solution for this - so you might need to create a support ticket for proper investigation.

Regards.

/Q

#90231
Sep 04, 2014 10:10
Vote:
 

No problem, Thanks for your time. I will raise a support ticket.

#90236
Sep 04, 2014 10:51
Vote:
 

Due to your support ticket, we reopen the bug for investigation, and a colleague of mine has this fix (in RenderBase.cs of Sample site)

Line 56:

if (!hasCatalogEditingAccess && new FilterContentForVisitor().ShouldFilter(CurrentContent))
{
AccessDenied();
}
Removing AccessDenied line and adding a custom code (such as returning 404 error) should do the trick.
I'm assming you're using Sample site as the template. Is this the case?
Regards.
/Q
#90448
Edited, Sep 10, 2014 5:50
Vote:
 

My application is an MVC project and not based on sample, will you advised me what will be best location for this check in MVC Enviornment, If you want to have a look on project You prbably will have FTP details.

#90456
Sep 10, 2014 9:41
Vote:
 

For MVC site it's a bit different. We discovered that for MVC site the problem is the same for page and product. Therefore the bug need to be fixed in CMS instead. So you'll need to wait a bit more to get the behavior you want.

Regards.

/Q

#90459
Sep 10, 2014 10:03
Vote:
 

If someone is intereted ... Bug id is 116989(Inconsistent behavior with unpublished content)

Once bug is made public that can be followed on http://world.episerver.com/Support/Bug-list-beta/

#90495
Sep 10, 2014 17:11
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.