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

Stock Module

Has anyone been able to, or will we soon be able to implement the stock and stock.api module into 4.7?

hook_nodeapi and form validation

I am using Drupal 4.7b4 and am having a problem with hook_nodeapi('validate'...) that I am really hoping someone can shed some light on.

I am using hook_nodeapi and hook_form_alter to add an image upload function to some of my existing nodetypes. My code works fine except if I preview a node before submitting it.

The problem is that hook_nodeapi('validate'...) is being called multiple times. My code looks as follows:

case 'validate':
if ($file = file_check_upload('nodeimage_upload'))
{
   $file = file_save_upload('_upload', _get_filename($file->filename), FILE_EXISTS_RENAME);
   ...
}

The first time $op='validate' is called, everything works fine, except that file_save_upload() removes the temporary file created when the node is submitted.
What this means is that for every subsequent call of hook_nodeapi('validate'...), I get the following error:
"The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename."

I have read the forums and everthing else that I can find in the docs and I still cant find out how to fix my problem. Very similar code in 4.6 worked fine. Is this a bug, a new feature introduced in 4.7 or simply a huge gap in my understanding?

The sequence of nodeapi calls I am getting is as follows:

  • load
  • prepare
  • validate
  • view
  • validate

Aggregator2 is it possible to make feed items a blog post

Is it at all possible to get Aggregator2 to post each item as a blog post in a certain blog rather than a news item?

how to retrieve the day select in the new date type form API?

Hello, I have a problem with this, I'm creating a module, and I put this in the form hook:

$form['group']['date1'] = array('#type' => 'date','#title' => t('Date1'),'#default_value' =>$edit[$form->fecha_carrera],'#required' => TRUE);

and then, in the insert hook I need to retrieve the selected day by the user... but if I do this (is an example):

$datetoinsert=$node->date1;
echo $datetoinsert;

I obtain "array", instead of the selected day by the user.

how do I limit one comment per node per user

hello.
I'm working on a board like content type and I like to enable authenticated users to leave only one comment for any node (adv.). user are not to see other users comments for this node at all.
How do I do that ?

filemangaer: replace copy with ftp

hi

several people (including me) seem to have php safe mode on and dont want to or dont have the chance to turn it off

is it not possible to replace the copy function with a ftp workaround?

in the file.inc on line 272 (4.6.3):

if (!@copy($source, $dest)) {
drupal_set_message(t('File copy failed.'), 'error');
return 0;
}

replace it with something like this (this code ist not working - i am not a programmer so thats only to show the idea):

Pages

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