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

What am I looking for this time?

I'm looking for something or some code that can work side by side with flexinode. My site is mostly for music reviews and I made flexinode define some fields such as artist, album, and genre. I want to be able to click on content, music reviews, then get a list of the different genres. Click on a genre and you are presented with a list of artists that a review exists for (leaving the possibility open for more than one review per artist or album) then maybe a list of their albums. Beside all the titles I'd want a number signifying just how many of these exist. And example.

Custom node type displays twice

I created a custom node type using node_example.module as a guide. I'm customizing the display when the node is viewed and it's working good, except that after it displays the node the way I've told it to, it repeats everything again and displays my custom node like it was a regular page, or blog (in other words, it prints the body and then who posted it and when). So, when I scroll down, all my blocks on the left are displayed twice and there is a redundant display of my custom node. What's going on?

tablesort and edit post (edit=Array in url)

in the tablesort and pager link, there is a bug: the form data isn't post correctly. The url is example.com?edit=Array and the data in array edit is lost. I use drupal-cvs.
Do you know if there is a code to resolve this bug (whitout change drupal core)? in the ufficial 4.7, will the bug fixed?

excuse my bad english
bye
Gianni

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.

Pages

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