This is my first time using this module, so I may be confusing something..
I have created subscription for paid adverts following instructions in the readme file. By default, my "adverts" content type (node) was set up to be published on submission. I thought that the lm_paypal will keep it unpublished until it's paid, but it looks like that page gets published right away even though it shows "not published" on the "LM PayPal Show Paid Adverts" page. Then, I went back and checked off the "Published" box in the default workflow options of the "content type edit" page. Now new "adverts" pages are not being published on submission, and they are still not published after the payment is received even though the "LM PayPal Show Paid Adverts" shows them "published" after the payment.
Seams to me "Published" and "Not Published" settings should be the same ones for nodes and lm modules.
Please show me the right way if I'm wrong.
Thanks for the module!
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | lm_paypal_subscriptions.node-publish.patch | 1017 bytes | infojunkie |
| #5 | 1.png | 2.18 KB | Clint Eagar |
| #5 | 2.png | 2.39 KB | Clint Eagar |
Comments
Comment #1
betsyj commentedNode subscriptions do not change the status of the node to published after payment:
-Lm_paypal reports that the node has been published when you invoke the node,
-the acutal status of the node is still "not published".
-My Account reports "No paid adverts".
-Clicking "Subscribed Nodes" in lm paypal subscriptions shows the node is subscribed and the user is live.
I am using drupal 5.3.
I will gladly do more testing and provide any other information you need.
Thank you!
Comment #2
gemini commentedAny updates on this issue?
Comment #3
SteveK commentedAlso getting this issue. Using sandbox for payment testing and drupal 5.11 as installation base. using d5 dev version
Comment #4
lyricnz commentedThere have been no significant code changes in over a year, so yes, the problem will still exist (until someone finds time to track this down).
Comment #5
Clint Eagar commentedI believe this is working as designed. The publish/unpublished doesn't work for me either, however a node that hasn't been "paid" for yet has node content of "Not yet published." See attached image #1. Then after I "pay" the node content is visible, see attached image #2.
Comment #6
Clint Eagar commentedAs a follow-up, the ideal functionality would be to unpublish/publish the node, this way it wouldn't be listed in taxonomy pages or in a sitemap.xml.
Comment #7
lyricnz commentedIf people are actually using these modules, perhaps we can have a discussion about what we should do going forward. In particular, the current design doesn't allow for much interaction with other modules (no hooks, actions etc), all of which would be really useful. In particular, we could make it so contrib modules could hook into the workflow at various points, to do things like this publish/unpublish.
Comment #8
lyricnz commentedAfter reading the code, it appears that LM Paypal does NOT publish/unpublish nodes in the Drupal sense of the word. What it does is, during node load, check to see if the current user has paid for this node. If so, the node is loaded intact, but if not, parts of the node are replaced with messages saying "pay to see this node". It appears to be an imperfect solution, since it seems it's still possible to view the node in other ways (eg: search results).
This is exactly the kind of thing we would like to make admin-configurable, so please add your comments to #328730: Make it easier to integrate with LM Paypal
Comment #9
lyricnz commentedComment #5 is correct - this is working as intended (however un-obvious that is). If you want "real" publish/unpublish, please consider contributing your thoughts to #328730: Make it easier to integrate with LM Paypal.
Comment #10
infojunkieUntil the LM Paypal integration is complete, here's a quick patch I used to publish/unpublish nodes based on the subscription status. I am using 6.x-1.x-dev.
Comment #11
publetariat commentedI've found that depending on what it is you're trying to do, the node's publication status may not matter. You can select or filter records based on whether or not the node's paid status = true. Here's my situation:
I'm running 6.10 core.
Created custom content type to use with Paid Adverts.
Set up subscription and associated it w/ new type.
Created two views, one to display all paid nodes and the other to search all paid nodes
I originally assumed LM_PayPal's "Published" status meant a paid node would be "Published" by Drupal, so I set up my views to filter based on whether or not node is published by Drupal. (Now I know this isn't true).
If I set default node publishing option to "published", node is published by Drupal when it's saved and link to it immediately appears in user profile under Paid Adverts, but is listed as "unpublished"---meaning LM_PayPal's "paid" flag is still set to false. The node also shows up in my two views, even though it's unpaid, since it's published by Drupal.
If I set default node publishing option blank the node isn't published by Drupal when it's saved, which prevents the unpaid nodes from showing up in my views, but an unwanted side effect is that no link to the node appears under Paid Adverts in user's profile. This makes it difficult for the user to find an unpaid node again to pay for it. Setting paid flag to true (using Admin mark As Paid option) makes the node show up in Paid Adverts section of user profile as "published", but node still isn't "published" by drupal so it still doesn't show up in my two views.
Member kratib let me know that the 'paid' status flag is in the lm_paypal_subscribers table, which also includes node id# (field 'nid'). Since nid is also part of the data set returned by a basic node-type view, I knew if I could somehow access lm_paypal_subscribers from within my view I could filter the records based on paid status *instead* of node=published. Searching for options to get at that table in a view, I found and installed the Views PHP Filter module, which allows you to filter Views content based on a PHP snippet. I figured I'd create a view with all the node information I wanted in it, then use Views PHP Filter to filter the list of nodes based on a SQL query that pulled the node IDs (nid field) from the lm_paypal_subscribers table.
But try as I might, I couldn't get my PHP snippet right; it just kept returning the first row of lm_paypal_subscribers, even using functions other than db_fetch_array. Thanks to site member nevets for this snippet, which works flawlessly:
$nids = array();
$result = db_query('SELECT nid FROM vault_lm_paypal_subscribers');
while ( $row = db_fetch_array($result) ) {
$nids[] = $row['nid'];
}
return $nids;
So that problem's solved, but there's still the issue of how to get unpaid/unpublished nodes to show up in user's profile (or somewhere else) so the user can easily locate any unpaid/unpublished nodes and pay for them. Again, member kratib comes to the rescue with this suggestion:
---------------------------------------------------------------------------
A query like
would show you the list of pending subscriptions for the current user.
Displaying this list in a block on the user's profile page might solve
your problem.
---------------------------------------------------------------------------
I haven't tried this yet, but I'm confident that between kratib's suggested code and the PHP snippet I'm already using in my views, I can get the unpaid/unpublished nodes to display in the user's profile---though not in the Paid Adverts block, it would be in a separate block or field, with the node id or name of the node output as a link.
However, since no one can view the full node until it's published, I've decided to change the default publication behavior of my PayPal Paid Advert content type back to "published" instead, so they'll immediately show up in the user's profile, listed as unpaid/unpublished in the Paid Adverts section. This wouldn't work if my views were still set to filter on publication status, but now that they filter on paid status, it'll solve my user profile problem without affecting my views.