Hi,

First of all, great work getting this developed and released for Drupal 6. I was very seriously considering developing a module to fill this need, and I was quite happy to see this was done recently.

I've started to test this out with Ubercart. Everything seems to be working well. I have only tested it with the "Other" payment type (and I manually update the order status to Completed) for now. I don't imagine it will make a difference when I test it with another payments types ... just FYI on what I've tested.

I came across one error that shows up on the customer's Pay per mode tab:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(n.nid), type FROM node n inner join paypernode_tracker pt on n.nid=pt.n' at line 1 query: SELECT title, created, changed, DISTINCT(n.nid), type FROM node n inner join paypernode_tracker pt on n.nid=pt.nid where uid=9 INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 9 AND na.realm = 'content_access_author') OR (na.gid = 2 AND na.realm = 'content_access_rid') OR (na.gid = 2 AND na.realm = 'workflow_access') OR (na.gid = 9 AND na.realm = 'workflow_access_owner'))) in ........../sites/all/modules/paypernode/paypernode.user.inc on line 44.

When I check the same page as admin in another browser (/user/UID/paypernode) I did not see this.

But from what I can tell, it hasn't interrupted the functionality. I was still able to create the node as a customer, and I was appropriately stopped from creating more than the number of nodes specified for the test product.

Thanks again, and I hope this helps for testing and development.

- Matt

Comments

maurizio.ganovelli’s picture

Hello Matt,

the problem seems to be caused by db_rewrite_sql call on line 44 of paypernode.user.inc.

    $created=db_query(db_rewrite_sql('select title, created, changed, n.nid, type from {node} n inner join {paypernode_tracker} pt on n.nid=pt.nid where uid=%d'),$uid);

I think this call can be deleted: this query extracts only nodes created by user through pay per node system. It's not necessary to apply restrictions by other modules (i.e. node access).

    $created=db_query('select title, created, changed, n.nid, type from {node} n inner join {paypernode_tracker} pt on n.nid=pt.nid where uid=%d',$uid);

If you can try this patch and confirm that solves the issue, i'll commit this change to repository.

WebNewCastle’s picture

Yes, fantastic! That took away the error.

I think I discovered something else in the process of testing further. I can post a new issue if it would be better. I don't think it's related to the above because I saw this before applying the patch.

When I test with a content type that is more one word (i.e "test_page" instead of "page" as the machine readable name), I am unable to create a node after purchase as a test user. The create link is there, but it redirects to the general Node Add page (i.e. looks like node/add even the URL is node/add/XXX). I think the issue may be an underscore instead of a dash in the URL (for the content type), although I didn't get it to work manually changing it (example: node/add/test_page to node/add/test-page)

- Matt

maurizio.ganovelli’s picture

Assigned: Unassigned » maurizio.ganovelli

Thanks again Matt!

Please create a new issue with new discovered problem. In this way, I can track down issues in commit messages easily.
I'll provide a solution for this as soon as possible.

WebNewCastle’s picture

Good point. I will do that. :-)

maurizio.ganovelli’s picture

Status: Active » Fixed

Patch commited to cvs

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.