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

paypal subscriptions doesn't appear to work

I'm trying to use the paypal subscriptions module for my web site.

I've got a longstanding merchant account. I've enabled IPN and told it to use http://mysite/paypal/ipn ...

I created a subscription button that matches the characteristics I want. I also created a matching subscriptions listing in the web site paypal config. Both have item number of "1".

I created a second account for testing purposes.

Adding new Nodes from another node's form

I'm having a hard time figuring this out. Could someone look at my schematic, and see if I'm going about it the right way, and maybe help me find the proper calls to make?

This is with HEAD CVS. I had it working with 4.6, but it seems to all be different now, and I'm still trying to make sense of the new process.

I'm trying to create an edit page for a node that will have several fields it will take care of (this part already works). After that, on the same page, I want to display the form to add an image node. Once a new image has been uploaded & the appropriate image node created, I want the new $nid of the image node returned for use by my other node.

Here's a rough flowchart in psuedocode:

function image_tab_display_tab
{
  Always display the other variables (already works)

  switch ($op)
  case ($op is "Submit")
  {
    Make any changes to variables from above (already works)
    Validate the new image
    If the new image validates
    {
      Save the new image node
      Associate the new nid (works when I can get proper nid)
      Show a new form to upload a new image if desired
    }
    else
    {
      Show any error messages from validation
      Show the preview form for the image node
    }
    case ($op is "Preview")
    {
      validate new image
      show any error messages from validation
      show preview form for the image node
    }
    default:
    {
      Show the "add image" form
    }
  }
}

For 4.6, I used node_submit somewhere in there, but it of course doesn't work any longer. Also, node_add doesn't seem to format the form properly anymore.

I'm having real problems figuring this out. Here's what I have right now, but it completely fails.

function image_tab_display_tab() {
  $op = $_POST['op'];
  $edit = $_POST['edit'];
  $node = node_load(array('nid' => arg(1)));
  $edit = array2object($edit);
  $output = '';
  if ($node->nid) {
    switch ($op) {
      case t('Submit'): {
        // Do some unrelated things (this part works)
        // ...
        $edit = node_validate($edit);
        if ($edit->nid && !form_get_errors()) {
          if (node_access('update', $edit)) {
           node_save($edit);
          }
        }
        else if (!form_get_errors()) {
          if (node_access('create', $edit)) {
            node_save($edit);
          }
        }
        // do some stuff with the returned $edit->nid
      }
      case t('Preview'): {
        // Do some unrelated things (this part works)
        // ...
        // This doesn't work properly
        $output .= node_preview(node_validate($edit));
        
        // This works as expected
        drupal_set_title(t("$node->title (preview new image)"));
        break;
      }
      default: {
        // put some unrelated fields; this part shows up okay
        // ...
        // This puts in the upload field okay, but is missing many fields
        $output .= node_add('image');
        
         drupal_set_title(t('%node-title (images)', array('%node-title' => $node->title)));
      }
  }
  print theme('page', $output);
}

When I execute this code, it displays a broken form for uploading an image. When I upload an image, it creates an empty node with nothing associated, and returns the value of the empty node (at least the association part is working). If I preview it, I can verify that it gets at least the title & description meant for the new node, which is also saved properly. It's the type & uploaded file that are getting mangled in the process. And, of course, it doesn't actually preview the uploaded image, and mangles the form.

Help!

- Aaron

Culture Fix Web Identity & Design
Digital Folk Art (my blog)

How to handle the language dependent variables or language dependent tables

Hi,
I'm new to the Drupal, in fact just installed it on my host server for 2 days.
The first thing I want to do is add my native language, which is Chinese, to my site; but I don't want to get rid of the English. So, I enable the locale module and insalled the i18n module.

Unable to configure Flexinode module

Hi,

When i try to open the flexinode page from Adminster > Settings, i see this error for any type of themes. Please let me know why i'm getting this error.

warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/apache2/www/modules/flexinode/flexinode.module on line 785.
warning: implode() [function.implode]: Bad arguments. in /var/apache2/www/modules/flexinode/flexinode.module on line 110.

thanks

A question regarding module's API and database scheme changes

Hi,
All over drupal.org there are code snippets that are querying the database directly for table schemes of core/contributed modules. This seems like a bad thing to do since the scheme can be changed and then everything might break. If modules don't define a clean interface for their functionality then you have to resort to direct database queries.
For example - How can I load only blog entries which were created on the second week of last month?
what do you think about this issue?

Help me, please! HTMLArea's problem.

Please, go www.volcano.org.ru, login test, password test.
Go Create content -> page and push button "insert/modify image" in HTMLArea.
What is a window opened? Why?

Excuse me, I speak English very bad.

Pages

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