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

Bug in 4.7 form_execute?

I have a module with a form_name, form_name_validate and form_name_execute. In cvs version the module work, in 4.7 the function form_name_execute don't start..... is a bug of 4.7? The code:


<?php

function test2_form_help($section='') {
$output = '';
switch ($section) {
case "admin/modules#description":
$output = t("Insert test2_form");
break;
}
return $output;
}

function test2_form_perm() {
return array('access content', 'access test2_form', 'administer test2_form');
}

function test2_form_menu() {
$items = array();
$items[] = array(
'path' => 'test2_form',
'title' => t('test2_form insert'),
'callback' => 'test2_form_exe',
'access' => user_access('access test2_form'),
'type' => MENU_NORMAL_ITEM );
return $items;
}

function test2_form_exe() {
$output .= test2_form_form();
print theme('page', $output);
}

function test2_form_form(&$value = NULL)
{
$form['#method'] = 'post';
$form['#action'] = 'test2_form';
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Is Only a test2_form_form'),
'#size' => 50,
'#maxlength' => 50,
'#required' => TRUE,
'#value' => $value['name'],
);
$form['submit'] = array('#type' => 'submit', '#value' => t('confirm'));
$output = drupal_get_form('test_form', $form);
return $output;
}

function test_form_validate($form_id, $form_values) {

Adding a new item to node menu

Hello!

I want to add a new item to the node menu (the edit/view tabs under the node title). I have constructed the following menu item, but it doesn't show up.

$items[] = array(
	"path" => "node/{$nid}/mymodule", //$nid was determined before 
	"title" => "My module action", 
	"callback" => "mymodule_additional_node_info",
	"type" => MENU_LOCAL_TASK,
	"access" => true //Just to make sure it really shows up
);

What am I doing wrong?

Html content on module landing page

I am using article module and I would like to add some content to mysite.com/article before showing all the articles. Where should I add html? please help.
Thanks in advance.
Kind regards
Onesimpleman

Newb needs help creating a basic node

I am new to the Drupal way of doing things and I've looked through a lot of docs pertaining to modules (and worked through a couple tutorials) but I'm still confused. Basically my main concern right now is that I can set up a node module (no block needed right now) and set up the settings function so that an admin user can change certain settings in the control panel. I don't really need all the advanced function hooks, just the basics plus the settings hook. What function hook do you use if you don't set up the module as a block?

Extend/Customize hook_settings?

I'll start this by saying that I'm working on my very first Drupal module, and I'm confused.

I'm trying to create a module that integrates Colourmod with Drupal to select colours. I've checked out the Colourmod installation instructions and the whole thing relies on some id's and classes being specified and detected by the scripts:

<div id="cmDefault">
	<div id="cmColorContainer" class="cmColorContainer"></div>
	<div id="cmSatValBg" class="cmSatValBg"></div>
	<div id="cmDefaultMiniOverlay" class="cmDefaultMiniOverlay"></div>
	<div id="cmSatValContainer">
		<div id="cmBlueDot" class="cmBlueDot"></div>
	</div>
	<div id="cmHueContainer">
		<div id="cmBlueArrow" class="cmBlueArrow"></div>
	</div>
	<div id="cmClose">
		<input type="text" name="cmHex" id="cmHex" value="FFFFFF" maxlength="6" size="9" /> <a href="http://www.colourmod.com" id="cmCloseButton" ><img src="/colourmod/images/close.gif" border="0" alt="Close ColourMod" /></a>
	</div>
	<div style="display:none">
		<input type="text" name="cmHue" id="cmHue" value="0" maxlength="3" />
	</div>
	<a href="http://www.colourmod.com" target="_blank" title="ColourMod - Dynamic Color Picker" class="cmLink">&copy; ColourMod.com</a>
</div>

So at this point I'm basically trying to get it working in the settings area to eventually specify "default colours" that would be able to be used by other modules. The problem is that the hook_settings only seem to allow form items and not any other code.

Could someone point out an example of a settings page that doesn't use the hook, a method to use the hook, or point out what I am missing?

Helper Script to migrate a module's from 4.6 to 4.7.

I started mucking around with Drupal 4.7 today. I was surprised by the total change to the forms API. I had already written a few modules for 4.6.3 and it was too much of a PITA to rewrite all the code manually. So instead I took a couple of hours to write a PHP script that would help me. Just put this somewhere in your drupal directory and access it through a browser.

Pages

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