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

Server side script to run (long time) and blank pages but no errors - please help!

Hi

I am embedding latex markup in book nodes and then generating the pdf files from it on the server. My books have become large so that the LaTeX processing takes quite long. Everything works perfectly for small books without any problems.

On the edit form I have a radio button for the user to select if they want to generate the pdf file - it just runs a small function in my module which makes a system call similar to:

system("files/latex/make_pdf_file.sh $filename");

For long compiles I get a blank white screen back after clicking submit. I have logged into the server and noticed that the script to make the pdf files is still running after the blank screen has shown up. I can see the static blank screen - type ls on the server and see no pdf file - wait a minute then ls again and the pdf file is there.

So my reasoning is that my little system call somehow takes too long and I am getting the first part of the drupal headers back but then somehow things get confused. The url for the blank screen is still the edit page: http://domain.name/?q=node/444/edit so refreshing to pressing enter just takes me back to the edit page even though the script did complete in the end.

I am not even sure where to start looking for a solution to this, is it something I can handle in drupal, or in php settings or would apache need modifications?

AJAX calls to the function occurred to me but I am not that adept yet but I think that could be a way out.

Limit the number of register user to a node in signup module

I'm install singnup module and enable the user to register to a node.
Up to here everything works well, but I need to limit the number of register user for each node, there is a way to do this? or is necesary to write some modifications to this module.

Thank's

Accessing Profile information from a Block

I want to create a block that alerts users of when people's bithdays are coming up. I want to add a date field into their profile that they can fill in, and then have the block look through the list of users and display any that have a birthday in the next week or so.

I understand how to access a single user's profile info when looking at their profile page with user->profile_field, but how would I go about searching the database for valid birthdates?

Thanks

Dynamic form - how to

Hi,

I need a help from Drupal guru with deep understanding of Drupal forms and forms processing.
I'd like to build a form that can change itself by adding or removing fields, as a reaction on the appropriate buttons and then catch all the fields data in _submit function.
Let me illustrate the task with the code below. It is a managing system of the spy store, where operator can add and remove orders of the clients and store results in the DB.

// get the data array (see function code below)
$data = get_data();

// build the form dynamically according to the $data array
$form['client'] = array('#type' => 'textfield','#title' => t('Client'),'#default_value'=> $data['client'],'#tree' => true,);
$form['orders'] = array('#type' => 'fieldset', '#title' => t('Orders'), '#tree' => true,);
foreach ($data['orders'] as $order_id => $order_description) {
$form['orders'][$order_id] = array('#type' => 'textfield','#title' => t('Order '.$order_id),'#default_value'=>$order_description,);
}

// first two options should modify the form
$form['add_order'] = array('#type' => 'button', '#name' => 'op', '#value' => t('Add order'));
$form['delete_order'] = array('#type' => 'button', '#name' => 'op', '#value' => t('Delete order'));
$form['submit'] = array('#type' => 'submit', '#name' => 'op', '#value' => t('Save'));

$output = drupal_get_form('client_form', $form);
return $output;

automatic flash video conversion, advanced uploading progress meter or progressbar

Were you searching out video sharing solution? Or did you hope to add cool progressbar?

We have hacked the video.module and image.module and they now feature
1 video file uploading
2 file uploading progressbar
3 video sharing and playing
4 official categories

You can login our website for further details. Our website is
http://www.maybor.com/

multi-page form gets redirected on certain pages (how do I intercept forms api calls)?

Hi,

I've got a large multi-page form (upwards of 11 pages depending on what user wants to fill in) that works, but for certain pages drupal intercepts the submit button and redirects to the first page (losing any entered variables for the last page the user was on).

The way I'm handling everything is:
Each form has a hidden variable that keeps track of the current page.
At the top of my page function, I'm checking for this variable in $_POST['edit'].
If it exists, I call a function to write the data to a specific db table, then build+render the form that corresponds to the submit button the user just pressed.
But on certain pages and for certain conditions, drupal resets the form and the $_POST and I can't work out why?
So if I goto page 1, enter some text, then click page 1's button; drupal resets the form
If I fill stuff in in a 'natural' order everything's fine until I get to a group of sub-category forms where drupal resets the form.

The user has to have the choice of filling in whatever data they want, and in whatever order. They also (due to the size of the thing!) need to be able to come back to it at a later date.

Is there anyway to tell the forms api now to reset the form?

I've seen a few posts regarding using $form['#redirect'] = FALSE; but what does it actually do, and would I need to change the way I'm doing things, ie doing the db stuff after rendering the form?

Pages

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