Trouble With Custom URL Rewriter after upgrade to 7.0.7

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

Trouble With Custom URL Rewriter after upgrade to 7.0.7

Post by jsmits » Wed Apr 06, 2011 8:05 am

Hello,

After upgrading my development site to 7.0.7 I am getting this error in th logs and none of my custom rewrites are working.

Any ideas?

Code: Select all

Unable to create instance for URL rewriter: UrlRewriter.CustomProvider, UrlRewriter	Method 'get_CacheSize' in type 'UrlRewriter.CustomProvider' from assembly 'UrlRewriter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

Re: Trouble With Custom URL Rewriter after upgrade to 7.0.7

Post by jsmits » Thu Apr 07, 2011 10:35 am

Is the information here out of date: http://wiki.ablecommerce.com/index.php/ ... ovider_API ?

This has been a bear to troubleshoot. My guess is that this is caused by the fact that I am upgrading from 7.0.4 which didn't have built-in URL Rewriting to 7.0.7 which does. It appears that my custom Url rewriter is looking for an implementation of get_CacheSize from IUrlGenerator or somewhere, but I can't seem to find it.

Maybe the solution is to use the built-in functionality, but that requires more legwork on my end.


If anybody has any suggestions, it would be greatly appreciated.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: Trouble With Custom URL Rewriter after upgrade to 7.0.7

Post by Logan Rhodehamel » Thu Apr 07, 2011 1:59 pm

In 7.0.4 we were just starting to think about a URL Rewriter framework. It's come a long way since then. If you want to fix this error AND protect yourself from future changes, update your custom url provider code and inherit from our abstract base class: CommerceBuilder.Catalog.UrlRewriterBase. This implements the interface for generating and parsing URLs.

Alternatively, implement the CacheSize property on your rewriter. It won't be used by your rewriter, but it is part of the interface. The abstract class defines it as a read/write property with a default value of 1000.

BTW yes, in 7.0.7 we've almost eliminated the need for a custom rewriter.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

Re: Trouble With Custom URL Rewriter after upgrade to 7.0.7

Post by jsmits » Thu Apr 07, 2011 2:09 pm

Thank you. Updating the the inheritance worked. Many thanks.

Post Reply