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

Forms Redirecting in Drupal 5 - Basic Question

I'm having a bit of a moment here. I've installed the Solr module, which is fabulous, except that I'm not able to get the search box form action to resolve to the appropriate "page." Somehow, the

?q=search/

is getting chopped off of the action upon submitting the form and I am redirected back to the home page, rather than to the search page. I know that I am missing something very, very basic here. Anyone care to enlighten me?

Here's the code from the module:

Fileshare module question

Hello everyone whos reading this. Im adding the fileshare module to my site. It has an upload button that allows you too upload files. Im loading a torrent file. Now what are the procedures. I assumed that I could upload the torrent from my computer to the page and so in return I got the browser quicktime tryna start after I clicked on the torrent file. Can someone help me out on this. Thanx

Very Odd User_Autocomplete Behaviour

Config:

  • Drupal 5.1, fresh install
  • Apache 2.2
  • Firefox 2 and IE 7

When I download and install any drupal module from the website, autocomplete for Authoring Information works fine, but when I install my own module it fails. However, the module I'm installing I've stripped down to just the barest of essentials, and still autocomplete spins, but does not show the list as it does with the more 'official' downloads. As soon as I uninstall the module, it works fine again. (The same thing happened with the fully coded module file as well, but I stripped it down to eliminate the possibilities.)

Any ideas would be greatly appreciated, as this is the last piece of functionality that I need to complete the set of modules I'm developing.

Included below are my module files:

company.info

; $Id: company.info,v 1.0 2007/04/01 12:00:00 mcunliffe Exp $
name = company
description = A module to manage a client companies.
package = "Client Company Manager"

company.install

<?php
function company_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE `company` (
`nid` int(10) unsigned NOT NULL default '0',
`vid` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`vid`,`nid`)
) ");
break;

"Audit files" module

I posted a query last night (here) asking if there was such a thing as an "audit" module to check uploaded files on a Drupal site. I got no responses and I fancied a project, so I have written one!

This started because I discovered my files folder contained hundreds (630 to be precise!) copies of a jpeg generated by the image module (no, I don't know why...). What I wanted was a way to find out what files were in my files folder that don't have an entry in the files table. Then I thought I would like the reverse query - check to make sure that everything in the files table has a corresponding real file!

When I audited my site with the module I found several hundred stray image files, and also six broken nodes that were missing their related file.

The module adds a new option to the Administer > Logs menu called Audit files (it drops it to the bottom of the list along with status). You can run two reports - Audit for files not in the database, and audit for files not on the server.

In the case of the first it produces a list (single page) and you can check files that you then want to delete (Remember to back up if in doubt!).

In the case of the second you get links to the related node so that you can investigate what is wrong.

how do i display a table of data from a remote database?

hi everyone,

this is a dumb question, but what is the best way to create a page that has the results of a database query? i'm still new to drupal, so the whole hooks, blocks, nodes, modules, etc thing is still a bit hazy for me. if anyone can point me in the right direction, it would be much appreciated!

fyi, the remote database in question is DB2 running on an iSeries machine, which i'm assuming means i'll have to use the ibm adapter for db2. but for now, displaying data from my local mySql database would suffice.

thanks!

Pre-populating Node Fields using node_add

I am creating nodes using this type of code:

   if (user_access('create '. $type . ' content')) {
     $output = node_add($type);
   }

What I would like to do is prepopulate some of the fields of the node with data when the form is displayed. Can this be done with node_add (I know you can do it with node_save, but I need to display a form), and if so, how?

Thanks.

Pages

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