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

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.

Moderation Queue and revisions - leave last approved revision visible

I have a website configured were users in "publishers" role can create/edit content and "editors" can approve it for display. If a "publisher" edits a node, a new revision is automatically made and the node is unpublished and placed back in the moderation queue for "editors" to approve.

The problem is when a vistor to the website tries to view a node that was once approved in the past, but has since been edited and moved back to the moderation queue they see the ACCESS DENIED screen.

Pages

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