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

form element size in contacts module

Hello,

I'm trying to find out where the lengths of the contact module form elements are set. When I view the source of my contact page, I see

From looking at form.inc, I see that size is being set to a variable called #size, but for the life of me, I can't find out where to set this. The current size causes the element to exceed the space I have set for it, and therefore displays an unwanted horz scroll bar.

#cols is the other one I'm after.

I also see

Accepting arbitrary payments in multiple currencies - which module turn to?

My website (a money transfer website) needs to accept user-specified amounts in user-specified currencies. I looked at two modules, LM PayPal and Ecommerce, and still find it hard to get my head around tweaking either of them to do what I need.
Let's say: user creates 'transfer' node, specifies all the data and proceeds to PayPal. After successful payment, transfer confirmation is returned.
Any ideas as of easiest way to do this?
Thanks.

nodeapi and node_save issues

Hi,

I'm working on a little module which opens a forum topic for each story you create. The story shows a link to the forum topic in place of the comments system and the forum topic shows the teaser of the story and a link back to this story.

The idea is to bring integration between articles and forums and having a specific forum which contains all the news discussion.

I'm trying to use Drupal's nodeapi so as to make this compatible with any type of node and node_save() so as to avoid having to deal with lower-level database calls.

Here are the two main problems I encountered during the development of this module. Any help would be welcome.

PROBLEM #1: using node_save() in a nodeapi 'insert' operation

The nodeapi hook performs actions when a node is submited, inserted, deleted, updated and viewed and node_save() takes a StdClass with the node's properties and creates the node.

I first tried with the submit operation of nodeapi and everything worked fine with the creation of the forum topic but I discovered that submit is also called when I modify a node so I tried with insert. Resulting in forum topics duplicating on each node modification.

how do i use pathauto for taxonomy_menu?

i've created a taxonomy_menu from my taxonomy/term. but i found the pathauto module only auto generates alias for taxonomy/term, but not for taxonomy_menu. anyone knows if it works for taxonomy_menu at all? do i have to manually do the alias?
thanks,
erick

File upload handling: temp files

A question, which should eventually be appended to http://drupal.org/node/117054.

In the MySite Icon module (part of http://drupal.org/project/mysite -- available in HEAD), I allow administrators to upload image files.

My understanding is that the file uploads are written to the /tmp directory by the FormsAPI and then validated. For instance, I run this code, taken from user.module, to ensure that the upload is in fact an image:

  // Check that uploaded file is an image
  $info = image_get_info($file->filepath);
  if (!$info || !$info['extension']) {
    form_set_error('icon', t('The uploaded file was not an image.'));
  }

If this succeeds, I then move the file into the proper /files directory.

My naive question: If the $info check fails, do I need to expressly delete the file from the /tmp directory, or does that happen automatically as part of the upload process?

For reference, here's the entire validation function:

<?php
function mysite_icon_validate_picture($file, &$form_values, $form_element = 'icon') {
// get the size restrictions
list($maxwidth, $maxheight) = explode('x', variable_get('mysite_icon_dimensions', '120x60'));
$size = variable_get('mysite_icon_file_size', 32);

// Check that uploaded file is an image
$info = image_get_info($file->filepath);
if (!$info || !$info['extension']) {

LDAP groups -> Drupal Role: Problem with “groups of groups”

I’m about to complete successfully the installation of Drupal. I’m using it with a Windows 2000 server Active Directory and also the LDAP integration, groups & data module. All modules run correctly and the Drupal’s roles mapping for LDAP groups too but I’ve a problem with persons who are in a LDAP “group of group”: I’m using the group A and the group B from Active Directory, then I map those groups to Drupal’s roles A & B : No problem ! But if a person is in a group C, who is in the group B (or A) no group is assigned to this user...

Pages

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