Hi! I placed one valid cart link in the "Cart Links Restrictions" box, and entered a URL in the "Invalid Link Redirect Page" where my customers are to visit if they enter a link other than what I placed in the "Cart Links Restrictions" box, but when I enter an invalid cart link in my browser, Ubercart tries to add the product to my cart instead of redirecting to the URL I defined in the "Invalid Link Redirect Page".
Is this a bug, or is there some special technique I must use? I did not include the /cart/add/ part of the link in the "Cart Links Restrictions" page as stated in the Ubercart instructions manual, and also tried to include /cart/add/, but nothing seems to prevent Ubercart from trying to add a product to the cart even when I've listed only one link in the "Cart Links Restrictions" box.
Any help is appreciated!
Comments
Comment #1
tr commentedI cannot reproduce this in 6.x-2.x-dev. Restrictions work, so does the link redirect for invalid links. Ubercart cart links has an extensive set of SimpleTest cases which test restrictions and redirects, among other things. These test cases currently run without error.
Comment #2
IncrediBody.com commentedHave you tried this in v2.4? I wouldn't load a dev version until the changes are tested and become v2.5, but have you also not been able to replicate this in v2.4, or were there fixes in the 2.x-dev version that solved this problem?
Comment #3
tr commentedThere has been only one minor change in the restrictions code since 6.x-2.4 - the restrictions entered in the admin interface are now passed through trim() to strip whitespace from the beginning and end. I guess you could check to see if you've added spaces, or are using a WYSIWYG editor (which adds HTML tags to whatever you type) on this textarea.
Regardless, 6.x-2.4 is a fixed-point version and will never be changed. This issue doesn't exist in 6.x-2.x-dev so there is nothing to fix here.
I personally think it's a mistake to avoid 6.x-2.x-dev. The difference between that and 6.x-2.4 is that hundreds of bugs have been fixed in 6.x-2.x-dev. The difference between 6.x-2.x-dev and the future 6.x-2.5 is that 6.x-2.5 will have one or two fewer bugs than 6.x-2.4.
Comment #4
IncrediBody.com commentedThanks for the reply TR. I was including ?destination=cart/checkout at the end of the cart link restrictions, which was not recognized by the module. Once I removed ?destination=cart/checkout from the end of the cart restrictions link, the module recognized the link as valid and sent any other request to the URL I listed in the Invalid link redirect page box. When I included ?destination=cart/checkout in the cart restrictions link, the module did not recognize the link and sent me to the cart redirect page even when I requested the valid link.
So, in summary, the only info that should be included in the cart link restrictions box is that which occurs after the cart/add/ and before the ? (assuming you are redirecting a customer to a page after the product is added). I knew based on the Ubercart documentation that the cart/add/ should not be included in the cart link redirection, but did not know that the ?destination=cart/checkout needed to be excluded as well.