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

node_privacy_byrole module set up

Hi,

I'm currently using Drupal 4.7. Everything works fine except I tried adding a new module: node_prviacy_byrole as I'm trying to make a wiki like page.

After I enable it I keep getting the following error:

Fatal error: Call to undefined function: form_hidden() in /var/www/modules/node_privacy_byrole.module on line 426

Does anybody have any idea why?

thanks

Listhandler and postgres issues

Okay, I was not sure where to put this, so please excuse me if this is in the wrong place.

Here is the problem. I am using Listhandler, Mailhandler, forums and postgresql. When people mail to the mailing list, comments and new forum topics get posted. When I add a comment from the web interface the comment get's sent to the correct mailing list. When I post a new forum topic vai the web interface, the comment get's posted but no mail is sent. It just silently fails.

Here is the function that I *think* that sends the forum topic to the mailing list. If my understanding is correct, a node is inserted, the node_invoke_nodeapi function is called, all 'listening' modules with hook_nodeapi respond, including this listhandler one.


function listhandler_nodeapi(&$node, $op, $arg = 0) {

switch ($op) {
case 'update': // what to do with updates?
break;
case 'insert': // mail new forum topics to mailing list.

if ($node->type == 'forum') {
if($node->sentbylisthandler) { // avoid running an infinite loop.
// save ids in listhandler table.
db_query("INSERT INTO {listhandler} (msgid, nid, cid, pid, uid, mid, tid) VALUES ('%s','%s','%s','%s','%s','%s','%s')", $node->message_id, $node->nid, 0, 0, $node->uid, $node->mid, $node->tid);
// call watchdog
watchdog('listhandler', "Forum '". $node->title ."' inserted.");

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.

Pages

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