Finding logic flaw in wishlist module
As background, I'm attempting to modify the wishlist module (http://drupal.org/project/wishlist) to allow anonymous users to claim gifts for purchase. While I have most of it figured out, I think I found a bug lurking somewhere else (which may be why this was disabled originally). Here's what happens: When an anonymous user views the wishlist in list view, they will see the "Get this gift" link regardless of its purchase status. Authenticated users will properly get either "Get this gift" or "none left to purchase". For either type of user, on the full node view of the gift in question they will see the correct numbers for "number requested" and "number purchased", and other things on that page will properly reflect its status. I think I've narrowed down which section of code is responsible for the generation of that link in the "action" column of the list, and have provided it along with the working code from the node view for comparison at http://drupalbin.com/4455. However, my PHP skills are terribly lacking, so when things get nested that far I just get totally lost, so what I'm hoping is that someone else can look at what's going on there and spot the problem. -- Tony Yarusso http://tonyyarusso.com/
Quoting Tony Yarusso <tonyyarusso@gmail.com>:
As background, I'm attempting to modify the wishlist module (http://drupal.org/project/wishlist) to allow anonymous users to claim gifts for purchase. While I have most of it figured out, I think I found a bug lurking somewhere else (which may be why this was disabled originally). Here's what happens:
File a bug report in the wishlist project issue queue. -- Earnie http://r-feed.com Make a Drupal difference and review core patches. -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
Tony, I'm the maintainer of that module, and the wishlist issue queue is the place to file issues. On this particular concern the module won't allow anonymous users to purchase items by design. Two reasons. 1) there's also a "put a gift back" capability that requires that we know who the user is. 2) if anonymous users can get gifts off the list, than crawlers will end up following those links and will mark all your items purchased in a matter of days. Anonymous users see the non-functional "get this gift" link to drive them to click it, see that they need an account, and then enroll with your site. If you file an issue asking to allow anonymous users to purchase items, I'll reject it. :) If you've found another problem during your research, I do want to hear about it. File the details in the wishlist module's issue queue. Scott Tony Yarusso wrote:
As background, I'm attempting to modify the wishlist module (http://drupal.org/project/wishlist) to allow anonymous users to claim gifts for purchase. While I have most of it figured out, I think I found a bug lurking somewhere else (which may be why this was disabled originally). Here's what happens:
When an anonymous user views the wishlist in list view, they will see the "Get this gift" link regardless of its purchase status. Authenticated users will properly get either "Get this gift" or "none left to purchase".
For either type of user, on the full node view of the gift in question they will see the correct numbers for "number requested" and "number purchased", and other things on that page will properly reflect its status.
I think I've narrowed down which section of code is responsible for the generation of that link in the "action" column of the list, and have provided it along with the working code from the node view for comparison at http://drupalbin.com/4455. However, my PHP skills are terribly lacking, so when things get nested that far I just get totally lost, so what I'm hoping is that someone else can look at what's going on there and spot the problem.
On Fri, Dec 12, 2008 at 9:03 AM, Scott McLewin <drupal@mclewin.com> wrote:
Tony,
I'm the maintainer of that module, and the wishlist issue queue is the place to file issues.
On this particular concern the module won't allow anonymous users to purchase items by design. Two reasons. 1) there's also a "put a gift back" capability that requires that we know who the user is.
Yeah, although for my personal purposes that wasn't terribly important.
2) if anonymous users can get gifts off the list, than crawlers will end up following those links and will mark all your items purchased in a matter of days. Anonymous users see the non-functional "get this gift" link to drive them to click it, see that they need an account, and then enroll with your site.
If you file an issue asking to allow anonymous users to purchase items, I'll reject it. :)
Aaaah. I hadn't thought of the crawler issue. I knew there was some logical reason for anonymous purchases to be deliberately disallowed (which is why I was trying to mess with this on my own instead of using the issue queue), but wasn't sure what. Thanks for the explanation.
If you've found another problem during your research, I do want to hear about it. File the details in the wishlist module's issue queue.
Scott
I may have to submit a patch just with some extra comments then. ;) -- Tony Yarusso http://tonyyarusso.com/
participants (3)
-
Earnie Boyd -
Scott McLewin -
Tony Yarusso