I seem to have found a serious bug in lm_paypal. It's hard for me to believe this has not be uncovered after a year so I am asking if anyone else can confirm this bug.

We discovered in testing that the "my account" display of paid adverts changes in some unpredictable fashion when you click on the sort buttons for Title or any other field.

To verify this, I checked a clean install of head version lm paypal. paid for a story. it showed up in my accounts. Then I clicked on the sort arrow next to Title. The node disappeared and lm paypal displayed a message of no paid adverts. Click the arrow again, and it still says "no paid adverts."

When we do this on a site with many paid adverts, nodes are returned in a random and unpredictable fashion

I've posted an issue and written Lee. Lee is very helpful but is buried now and cannot address it immediately.

Comments

sampelo’s picture

Lee kindly took time out of his schedule and found the problem.

I've figured out what is wrong but don't have time to fix it at the moment.
In lm_paypal_paid_adverts_list_nodes the select/pager_query code finds all
the users nodes and processes them one page full at a time. Inside the loop
it works out which nodes have been paid for and displays only those. This
works in small test sites but if the user has a lot of nodes but only a
couple are subscribeable then it fails. The select/pager finds all the users
nodes but the loop body is only going to show a tiny number of them. Many
pages might be completely blank.

For the pager to work the select needs to find all the users nodes with a
type that can be subscribed to and also find whether the subscription has
been paid for. This will mean adding tests against the contents of
$type_subs and fetching the status for the node from the subscribers table.
Basically borrowing bits from lm_paypal_paid_adverts_has_sub and
lm_paypal_node_subscribed. I wont have any time to do this work till after
next Tuesday. But if you have a good programmer it shouldn't be too complex.