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

pathauto problem

Hey. I just installed the path auto module and when I go to: pathauto settings page i get this error:

Fatal error: Cannot use string offset as an array in /home/sittingo/public_html/modules/system.module on line 745

I was wondering if anyone knows what is wrong. Thanks!

newsletter reader

I subsribe some newsletters. I'm looking for a module that converts the receiving newsletter to node or rss item. Has anyone done that before? Thanks

Need serious help with file upload

I've spending a ton of time pouring over documentation and examples but can't seem to figure out just how to upload a file through a form. All I need to do is upload a file through a form on the module's settings page and pass it to a function that processes that file and then I don't ever need to see the file again. Can someone please help? Any and all is much appreciated. Thanks.

tinymce - removed, reinstalled - but wont create tables

ok - i deleted the tinymce tables from my database -- but now no matter what i do, i can't get the install to create the tables again... anyone know how to do this?

thanks!

Q: Can't upload images from my module

I have been trying to allow my module to upload images for the past few days and am getting very frusterated. I was reading through this thread: http://drupal.org/node/53621 and everything I'm doing looks to match this exactly. Since I still havn't been able to get it to work, I tried copying the code from the image.module directly into my module. (I can upload images correctly through image.module).

Right now I am only focusing on getting the hook_update part to work.

I have the following code:

<?php
function surgeon_form(&$node) {
$form['image'] = array('#type' => 'file', '#title' => t('Image'), '#description' => t('Click "Browse..." to select an image to upload.'));
return $form;
}

function surgeon_update(&$node) {
foreach ($node->images as $label => $image) {
$old_path = db_result(db_query("SELECT filepath FROM {files} WHERE filename='%s' AND nid=%d", $label, $node->nid));
if ($old_path != $image) {
//-------------------
//THE CODE GETS HERE AND STOPS. I DONT THINK IT
//HAS ANYTHING IN THE IMAGE VARIABLE
//THE SURGEONS DB_QUERY BELOW DOES NOT
//GET EXECUTED
//-------------------
db_query("UPDATE surgeons set tid = 55 where nid = 29"); //this does not get executed
file_delete(file_create_path($old_path));
db_query("DELETE FROM {files} WHERE filename='%s' AND nid=%d", $label, $node->nid);

Drupal modules extension philosophy

I'd like to know how to create new module's extensions for Drupal correctly?
For example I want to develop my customized forum but based on existing core forum.module logics.
How do I extend its functionality in accordance to my demand?

Do I grab forum functions code to my megaforum.module and change it? Or in what other way I have to do?

Thanks to everyone for attention!

Pages

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