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

Local task item path misbehaving

For a group of local task items I have a default item with a path as 'whalemail/addressbook/index' and yet when drupal renders the page it just uses a path of 'whalemail/addressbook'... WHY?!!! This is driving me nuts.

A module installed in 'sites/example.com/modules' should override the same module installed in the main 'modules' directory.

With multi-site set ups, it is possible to add a module to a single site by installing it in 'sites/example.com/modules'. This works as expected. By this same logic, I shouldn't I be able to override existing system-wide(shared) modules in the same way?

AJAX form_autocomplete problem

Hi,

I was trying to use the form_autocomplete functionality, however I got some problems. I have downloaded the latest drupal HEAD version.

When I for example user the already included user/autocomplete everything works fine:

function _messenger_addressbook() {
$output = '

Messenger! Addressbook

';

$author = form_autocomplete(t('Username'), 'user', '', 30, 60, 'user/autocomplete', NULL, NULL, TRUE);
$form = form($author);
$output .= $form;

print theme("page", $output);
}

But when I try to do this myself there is something wrong:

function messenger_menu($may_cache) {
global $user;

$items = array();
$view_access = user_access('access messenger');

if (!$may_cache) {
$items[] = array('path' => 'messenger/user_autocomplete',
'title' => t('messenger user autocomplete'),
'callback' => 'messenger_user_autocomplete',
'access' => $view_access,
'type' => MENU_CALLBACK);
$items[] = array('path' => 'messenger/compose',
'title' => t('compose message'),
'callback' => '_messenger_compose',
'access' => $view_access,
'type' => MENU_NORMAL_ITEM,
'weight' => 4);
...
}
return $items;
}

function _messenger_compose() {
$output = '

Messenger! Compose message

recursive functions

could anyone point me in the right direction for a way to find the number of nodes in a taxonomy term, as well as all of the child nodes underneath it?

recursive functions aren't a strong point of mine, so any resources, pseudo code, etc would greatly help

thanks

what am i doing wrong?

<?php

function taxonomytree_menu() {
	$items = array();
	if($may_cache) {
		$items[] = array(
			'path' => 'taxonomytree',
			'title' => t('taxonomy tree'),
			'callback' => '_taxonomytree_page',
			'access' => user_access('access content'),
			'type' => MENU_CALLBACK
		);
	}	
	return $items;
}

/*
	Function to give drupal information about the module
*/
function taxonomytree_help($section='') {
	$output = '';
	switch($section) {
		case "admin/modules#description":
			$output = t('Displays a taxonomy tree for vocabularies with current nodes underneath');
			break;
	}
	
	return $output;
}

/*
	Return permissions for the module
*/
function taxonomytree_perm() {
	return array('access taxonomytree');
}

/*
	Return settings HTML or deny access
*/
function taxonomytree_settings() {
	if(!user_access('admin taxonomytree')) {
		return message_access();
	}
	$output = form_textfield(t('Maximum number of links'), 'taxonomytree_maxdisp', variable_get('taxonomytree_maxdisp', '25'), 2, 2, t('The maximum number of links to display per page.'));
	return $output;
}

/*
	Page content for taxonomytree
*/
function _taxonomytree_page() {
	$output = 'this is where the content for the taxonomy tree module will go');
	return $output;
}
?>

when i go to the url of my new module that i am working on, it says that the page cannot be displayed.

Need help with module development. Will pay!

I have been asked to work on a project in which users can search a database, much like Google by asking questions. Such as, "where can I get my computer fixed?" Then it will display a list of links with contact information on local computer businesses much like the yellow pages. The database will be composed of paying and non-paying subscribers. Paying subscribers need to be listed first and upon clicking their link it should display more information including a video or flash advertisement. Preferrably clients could login and edit their information.

Pages

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