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

error when not logged in

I am getting this error when viewing my site without logging in. user warning: Unknown column 'grant_edit' in 'where clause' query: SELECT COUNT(*) FROM node_access WHERE (nid = 0 OR nid = 1) AND ((gid = 0 AND realm = 'all')) AND grant_edit >= 1 in /home/warpgate/public_html/drupal/includes/database.mysql.inc on line 120.

How to determine module URL?

I'm sure this is a very easy question, but I haven't been able to figure it out for anything. How do I determine the URL of the currently running script? The closest I've been able to come up with is request_uri(), but that won't work because it leaves the any query strings in tact. I need a way to get just the URL of the current module.

For example, I have a module that includes different pages depending on which date was passed, like so:
/dailystrips?date=xxxx.xx.xx

make list with download and delete

I want to make a list of files in {dir_name} with download and delete.

I stuck between function editor_delete() and modul_delete_confirm_submit() , when I press delete button (first function) nothing happened. But I can't understand why ? And I don't know how to make dowload for files in the list.

I've been trying to fix a problem with my module, but
Here's my (shortened) code example:

<?php
if ($may_cache) {
$menu_type = MENU_CALLBACK |MENU_VISIBLE_IN_TREE
|MENU_MODIFIABLE_BY_ADMIN;

$retval[] = array(
"path" => "admin/module",
"title" => t("module"),
"access" => user_access('access module page'),
"callback" => "module_page",
"type" => $menu_type,
);

$retval[] = array('path' => 'admin/settings/module',
'title' => t('module'),
"access" => user_access('module configuration'),
'callback' => 'module_configure');

if(arg(2) == 'delete')
$retval[] = array('path' => 'admin/module/delete/'. arg(3), 'title' => '', 'access' => user_access('access module page'), 'type' => MENU_CALLBACK, 'callback' => 'editor_delete');
}

return($retval);

}

function module_page() {
$content .= _module_files_display3();
return($content);
}

function _module_files_display3() {

$header = array(t('File name'), array('data' => t('Operations'), 'colspan' => 2));
$dirname = 'mydir';

How do I commit HEAD branch with files that are currently in DRUPAL-5 branch?

How do I commit HEAD branch with files that are currently in DRUPAL-5 branch?

How to use form validate hook/function?

I'm brand new to Drupal, but I've been making pretty decent on a module by reading through examples and the API documentation. However, I'm having an issue that form validation that I just cannot figure out. Basically, according to everything I've read, a form_name_validate function should automatically validate any forms named form_name (unless, of course, it's overridden). However, this isn't happening. Here's a snippet my code:

function ssh_page() {
$output = '';
$host_options = array(
'server1' => t('server1'),
'server2' => t('server2'),
);
$form['host_select'] = array(
'#type' => 'fieldset',
'#title' => t('SSH Server Selection'),
'#tree' => TRUE,
);
$form['host_select']['hostname'] = array(
'#type' => 'select',
'#title' => t('Hostname'),
'#default_value' => variable_get('hostname', ''),
'#options' => $host_options,
'#required' => TRUE,
'#description' => t('SSH Server name.'),
);
$form['host_select']['port'] = array(
'#type' => 'textfield',
'#title' => t('Port'),
'#default_value' => variable_get('port', '22'),
'#size' => 5,
'#maxlength' => '5',
'#required' => TRUE,
'#description' => t('SSH Server port.'),
);
$form['host_select']['submit'] = array(
'#type' => 'submit',
'#value' => t('Connect'),
);
$output = drupal_get_form('ssh_host_form', $form);

$node->path Not Available For Anonymous Users

You should use drupal_get_path_alias instead and remember to always test your modules and code as a anonymous user too.

Pages

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