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

Problems with menu entries & hook_help (caching ?) on Drupal 4.7 beta 5

Hello all.
I'm experiencing a strange behavior on Drupal 4.7 beta 5 (even with a brand-new instance being installed).
Let's suppose that I just downloaded & unpacked a module on /modules/... let's say, "layouteer". When I go to /admin/modules, the module _is_ on the list, but the "Description" field is blank. That happened when I installed the "views" module some days ago and with a module that I started writing. First I thought that the _help hook format (or result type) should have changed, but after checking existing working modules (like forum.module), I realized that the code below was just right:

function layouteer_help() {
	$section = (func_num_args() ? func_get_arg(0) : '');	
	switch ($section) {
		case 'admin/help#layouteer':
			$output = '<p>'. t('Allows you to create customized pages arranged with one or more existing pages.') .'</p>';
			return $output;
		case 'admin/modules#description':
			return t('Allows you to create customized composed pages.');
	}
}

And the same with all registered paths (hook_menu) stuff. Even when the module is enabled, the menu items related to the module are not shown nor accessible by the URL directly. Let's say that I installed the module "layouteer" and it has two paths registered like:

<?php
function layouteer_menu($may_cache) {

$items = array();

if ($may_cache) {

$perm_create = user_access('create layouted pages');

How do I create a PHP Block that shows the most recent "sticky" node of taxonomy "Promo Image"

I would like to create a PHP Block that displays the most recent "sticky" node of taxonomy term "Promo Image" which is a gallery in "Image Galleries." Basically the point of this is to show an Promotional Image in a block on the homepage.

I thought I could get this done with node_load() but I doubt I can give taxonomy conditions with node_load. I'm guessing I need my own query so I'm scared. Help me.

Jay

Adapting from another module gives SQL error

Hoi!

I'm trying to adapt the moviereview module to a gamereview module, but for some reason, it fails when it's going to insert a review into the databse. It gives the following output:

warning: sprintf(): Too few arguments in /blah/includes/database.inc on line 154.
user error: Query was empty
query: in /blah/includes/database.mysql.inc on line 66.
warning: Cannot modify header information - headers already sent by (output started at /blah/includes/common.inc:384) in /blah/includes/common.inc on line 192.

So, apparently the SQL query is empty... this puzzles me, however, since all I've done in the migrating was to change every instance of "movie" to "game", including the sql table, css file and so on. (Everything is displayed correctly, also the preview when submitting a review).
Here is the gamereview insert function and the moviereview equivalent:

<?php
function gamereview_insert($node) {

db_query("INSERT INTO {gamereview} (nid, gametitle, release, cover, genre, language, media, price, rating, review, systemreq) VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s')", $node->nid, $node->gametitle, $node->release, $node->cover, $node->genre, $node->language, $node->media, $node->price, $node->rating, $node->review, $node->systemreq);

$numlinks = count($node->gamelinks);
for ($i = 0; $i < $numlinks; $i++) {

Forms, callbacks, and handling

Hello,

I am working a custom node module to expose CiviCRM records to users on a website. The goal of the module is to set up a "campaign" node with a group from CiviCRM that my users will contact. I want to make the contact methods modular, so that people can write new modules to allow for new methods of contacting the targets (some examples: email to the targets with a sample letter, provide the target's phone number and log a phone call, provide a door-knocking list for canvassers, etc).

Q: Display $breadcrumb variable from within a block?

Is it possible to display the $breadcrumb variable from within a block? I have tried using the variable '$breadcrumb' in an existing block but nothing shows up. I guess this only works when called from page.tpl.php?

Any help would be greatly appreciated.

Thanks!

Aggregator2 cvs module does not generate blocks with 4.7 beta 5

I am the webmaster of an interactive news portal where aggregator2 is an integral module. I am trying to make the transition from Drupal 4.6.5 to 4.7 (the themes are so much better) but I can't until aggregator2 works with 4.7. There is not currently an official 4.7 version of aggregator2 released but the cvs version does have some edits to make it ready for 4.7. Right now, the agggregator2 module works well but it is not generating blocks with the titles of the feed items. Does anyone know how to fix this? Thanks!

Pages

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