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

Problem with Module Sections and rc3+MySQL 4.0

Hi,
I installed Sections module on my site (rc3+mysql 4.0) but I got an error and couldnt install it (see my bug report : http://drupal.org/node/59579).

I removed the ENGINE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */ part from the sections.install file and tried to reinstall the module, but I still got the errors : TABLE sections_data doesnt exist ...

So I tried something else, I installed a new drupal site with a fresh new db (still 4.0) and installed the corrected module, and it worked fine.

Captcha.module questions

I installed it on a site running 4.6 and I can't seem to make captcha appear in comments. I've enabled the module, set it up and gave access. It works for new registrations, but not for comments. What am I missing?

Also, is the captcha module working on 4.7?

Help would be highly appreciated.

Calling mail() or user_mail() from a PHP page snippet

I am trying to send the results of a non-Drupal form using Drupal's user_mail function in the user.module. The PHP form in question existed before we switched to Drupal, and I was hoping to get it working with a minimal amount of fuss. So far, so good except for one thing: whenever I evoke PHP's mail function, or Drupal's own user_mail function, I end up with *two* emails being sent rather than one.

I've been experimenting with various ways around this (I'm assuming that the second e-mail is being sent when Drupal pre-processes the PHP; this plays havoc with functions not declared in modules as well) and after reading through the PHP snippets documentation my current tack was to create a new helper module to handle the e-mail sending.

Here's what I'm doing right now. I have created a module called "its_library.module". The contents of the module are as follows:

<?php
function its_library_help($section='') {
$output = '';
switch ($section) {
case "admin/modules#description":
$output = t("ITS Library Functions.");
break;
}
return $output;
}

function _its_library_sender() {
$to = "[valid@email.com]";
$subject = "Test Subject";
$body = "Test Body";
$headers = "From: [valid@email.com]\nReply-to: [valid@email.com]\nX-Mailer: Drupal\nReturn-path: [valid@email.com]\nErrors-to: [valid@email.com]";
user_mail($to, $subject, $message, $header);

Menu Grouping HOWTO?

Dear friends,

I would like to have a menu grouping item 'khimik', which contains two sub-items: 'manage issues' and 'add an article'. 'khimik' itself must lead to a page which gives the same choice i.e 'add an article' and 'manage issues'.

'add an article' leads to a form allowing the addition of a certain node type (which is 'khimik' for sure!) while 'manage issues' must call some dynamic page callback.

Should I use a node based module?

For my module I want to display a page containing a list of "items".
(The page only displays a list of "items" that were created by the user).
I want each "item" in the list to be clickable - When an item is clicked I want to display editable fields - the user can update their "items" fields.

My question is, can I and should I do this using a node based module?
Do modules have to be based on nodes?

Thanks,
David

problem with drupal_get_breadcrumb()

Hi

I'm trying to write a module that does some additional work with nodes when displayed. I'm using the hook_nodeapi() to access the node as it's about to be displayed.

One of the things I want it the breadcrumb array. So, in my hook, I call drupal_get_breadcrumb() to actually get it. However, it seems to just set the live breadcrumb to "Home" and I loose the breadcrumb.

Pages

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