This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

paypal_subscription timing/sequence issues

[I posted this yesterday as a reply to another topic in "How do I..." but it's fallen pretty far down the list, and this is probably a better place to ask my question anyhow.]

I've been trying to get paypal_subscriptions working on my local test site, and it seems to be working now, but only after several hours of debugging and fixing stuff... and I'm still left with one issue I don't understand at all.

A bit of background:
I originally started using the ecommerce module and had hacked the ps module to work with it. I only did limited testing, but it seemed to be working. Unfortunately, the ecomm module wasn't cutting it - it was too complicated for what I need (and not flexible enough), the user experience was painful, and I found I was just working around it too much.

So, I ditched ecomm and chose to use paypal_framework (plus a few functions from the ecomm paypal) with the ps module and some custom code to handle my needs. I have a couple of extra modules that use the paypal_transaction hook for some of my custom processing.

The problem:
The paypal_transaction hook is called in ps upon receiving an IPN, but no matching data is found. When the same query is run in MySQL, data shows up. After some investigation, I determined that there's some sort of timing/sequence issue. Running the query in one of my other modules (called after ps), returns data. Yet even if I put a usleep() in ps, even if I loop it 100 times, that query still fails. It only works if ps is the last module called with paypal_transaction.

Thought about Component Architecture in Drupal (A Message Bus technique)

Intro

I'm relatively new to Drupal, so may be these ideas were discussed previously, if so please post a link here. I've got these ideas while reading Drupal docs, module development guide and handbooks on other application servers with component architecture.
While developing complicated modules with many components one can meet a problem of controlling interaction between them, especially with modules developed by other people. Here developers have to know deeply how to invoke foreign module's methods, which functions, parameters and responses they have to use. But in this case if modules "know" to much about each other they become very tied to each other. And developer have to pay much attention to this compatibility and not to break in in further versions. So much awareness leads to loosing flexibility from modular structure.

Interfaces are not panacea

I think direct calling function from foreign modules are evil for the further development process. Module functions should not be called directly except several interface methods which have fixed well-documented parameters and responce. Other methods should be private.
Like Drupal core invokes hooks from different modules. And these hook methods could be said as interface methods of the module for interoperaton with core. That's a great idea, but I think it is less suitable for working between modules. Because inter-modules operations are much more different and interfaces are to be more flexible to support calls which tends to be more complacted. How to keep compatibility in this case? Is it vicious circle?

Move node's $links into a block?

I wonder if anybody can offer pointers about how to move all the links for a node into a block? So, each node's full page view displays a block taking you to the links for that node.

Thanks!

feature request/wish: rating system

in addition to posting comments, can the user (perhaps and the author) rate a node/article?
and further, the rated nodes/articles can be sorted by ratings/stars?

Code for a Site Help Module open for comments

I'm working on another much larger module and one of the pieces I needed was a site help feature for users specific to roles. Instead of folding it into my module, I decided it would be better implementented as it's own module.

The intention of Site Help is to create a simple, site help content infrastructure suitable for site users in understanding how to use aspects of the site.

I've only recently been approved for a CVS account, and still need to learn how to use CVS. I'm also quite busy putting the finishing touches on my other module, which is my first priority. But I thought I would post this code here for anyone who may want to look at it and try it out. It has only been tested a little by me. If anyone has a CVS account and wants to create a project around this, I would be more than happy for you to do that. If you would like me to be co-maintainer, I would be happy about that too. If no one takes up that offer, I will eventually create a project around it myself (assuming comment and suggestions warrant it), but it will probably take me a few weeks to get around to that.

Would really like to hear comments and suggestions.

Here is the needed SQL (mySQL only, sorry postgres folks, I am not very familiar with postgres).

CREATE TABLE `site_help` (
`nid` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL ,
`site_help_type` VARCHAR( 100 ) NOT NULL ,
`site_help_roles` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY ( `nid` ) 
) TYPE = MYISAM ;

Here is the module
<?php
/**
* Implementation of hook_node_name()
*/
function site_help_node_name($node) {
return t('site help');
}

/**
* Implementation of hook_help()
*/
function site_help_help($section) {
switch ($section) {
case 'admin/modules#description':
// This description is shown in the listing at admin/modules.
return t('Allows creation of a simple site help content infrastructure suitable for site users.');
case 'node/add#site_help':
// This description shows up when users click "create content."
return t('site help is content intended to help users understand how to use aspects of this site.');

case 'admin/help#site_help':
$output = '

The intention of Site Help is to create a simple, site help content infrastructure suitable ';
$output .= 'for site users in understanding how to use aspects of the site.

Ecommerce subscription

Hi,

Using Ecommerce module, Is it possible to create products that assign users to an existing role (authenticated, publisher, etc.) ?

Paypal_subscription module provides this functionality.

All comments greatly appreciated.

Thanks, Darly

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions