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

node_save fails to recognise immidiate alterations to the node

Hey all,

In a custom module of mine, I have 2 methods which loads a CCK node and alters some of the content. The issue is that only the changes from the last executed node_save is recorded in the database. The 1st save operation is always ignored! Am I doing something wrong here?

Example code:

Node mover

Hi to all! :)
I found very interesting module Comment mover which can move comments to another node
I need advanced version of this feature - move nodes from one blog to another
What can you advice?

help creating a form - I am stuck

I am trying to learn to make modules, and I am using the drupal book 'Pro Drupal Development' So there is a module for this tabbed menu, well the book only adds content to the front page, I am trying to take it futher..I want to make a form for the 'Add Flavor' page. All I want it to do is have a text field that you type the flavor into and then submit it---for now that is all I am trying to do and I can get the form to display, the only thing it displays is the word 'Array' capitalized just like that...

...here is the code for the whole module, my code is at the bottom

<?php
// $Id$

function milkshake_perm() {
return array('list flavors', 'add flavor');
}
/**
* Implemetation of the hook_menu().
*/

function milkshake_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'milkshake',
'title' => t('Milkshake flavors'),
'callback' => 'milkshake_overview',
'type' => MENU_NORMAL_ITEM
);
$items[] = array(
'path' => 'milkshake/list',
'title' => t('List Flavors'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'access' => user_access('list flavors'),
'weight' => 0
);
$items[] = array(
'path' => 'milkshake/add',
'title' => t('Add Flavor'),
'callback' => 'milkshake_add',
'type' => MENU_LOCAL_TASK,
'access' => user_access('add flavor'),
'weight' => 1

How to find out node type when invoking hook_comment() ?

I'd like to execute hook_comment() only when a comment action is being performed on let's say 'image' node type. How do I retrieve node type when executing hook_comment() ?

I have something like:

function mymodule_comment($a1, $op) {

	if ($op == 'insert' OR $op == 'delete') {
		$var = 'display_album_';
		cache_clear_all($var, 'cache', TRUE);
	}
}

So I dont need this to be executed when commenting on any node type... just 'image' node type.

Thanks,

k.

A module that would assign an image to a content type

I could not find a module that would display an icon (default or 'user chosen', but not a logo) for a given node type. As a newbie with templates, as many Drupal users, I think this would be a good feature.

It would definately ease managing documents. Indeed, if the node title for a unique content is often similar (ex. mass imported photos and videos of the same event, but which require a node each), an icon displayed just before the node title (or even weighted) would quickly inform on the node type, at least.

Map module

Hi, sorry if this info is searchable, but then I still would have this same question:
Is there a simple map module for Drupal? I am planning to use it for displaying universities linked to teachers located in specific countries. Thanks

Pages

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